Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish switching logic and auto switch ha code #4406

Conversation

RongtongJin
Copy link
Contributor

Make sure set the target branch to develop

What is the purpose of the change

XXXXX

Brief changelog

XX

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@RongtongJin
Copy link
Contributor Author

@hzh0425 PTAL~

@hzh0425
Copy link
Member

hzh0425 commented Jun 3, 2022

Maybe something wrong when change the logic

@coveralls
Copy link

coveralls commented Jun 3, 2022

Coverage Status

Coverage increased (+0.07%) to 47.506% when pulling 50cd646 on RongtongJin:5.0.0-beta-dledger-controller into 12d9207 on apache:5.0.0-beta-dledger-controller.

@codecov-commenter
Copy link

Codecov Report

Merging #4406 (50cd646) into 5.0.0-beta-dledger-controller (12d9207) will increase coverage by 0.00%.
The diff coverage is 60.00%.

@@                       Coverage Diff                        @@
##             5.0.0-beta-dledger-controller    #4406   +/-   ##
================================================================
  Coverage                            43.30%   43.30%           
  Complexity                            6338     6338           
================================================================
  Files                                  839      839           
  Lines                                59637    59637           
  Branches                              8130     8131    +1     
================================================================
+ Hits                                 25824    25826    +2     
+ Misses                               30469    30462    -7     
- Partials                              3344     3349    +5     
Impacted Files Coverage Δ
.../rocketmq/broker/hacontroller/ReplicasManager.java 0.00% <0.00%> (ø)
...main/java/org/apache/rocketmq/store/CommitLog.java 67.99% <ø> (ø)
...mq/store/ha/autoswitch/AutoSwitchHAConnection.java 73.40% <50.00%> (+0.07%) ⬆️
...q/controller/impl/manager/ReplicasInfoManager.java 61.80% <100.00%> (ø)
...ketmq/store/ha/autoswitch/AutoSwitchHAService.java 55.40% <100.00%> (-0.60%) ⬇️
...org/apache/rocketmq/common/stats/StatsItemSet.java 41.79% <0.00%> (-8.96%) ⬇️
...ava/org/apache/rocketmq/filter/util/BitsArray.java 59.82% <0.00%> (-2.57%) ⬇️
...rocketmq/broker/processor/PopMessageProcessor.java 39.03% <0.00%> (-0.54%) ⬇️
...ent/impl/consumer/DefaultLitePullConsumerImpl.java 67.92% <0.00%> (-0.52%) ⬇️
...cketmq/broker/processor/PopBufferMergeService.java 40.71% <0.00%> (+0.23%) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12d9207...50cd646. Read the comment docs.

@@ -100,9 +100,6 @@ public AutoSwitchHAService() {

this.defaultMessageStore.recoverTopicQueueTable();

final HashSet<String> newSyncStateSet = new HashSet<>();
newSyncStateSet.add(this.localAddress);
setSyncStateSet(newSyncStateSet);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在 controller 里的逻辑是, 新选举出来的 master, syncStateSet 只有该 Master, 这里是为了应和 controller 里的逻辑.

Copy link
Member

@ShannonDing ShannonDing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ShannonDing ShannonDing merged commit f27800a into apache:5.0.0-beta-dledger-controller Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants