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

[ISSUE #5663] Fix Messages may be lost when SyncStateSet expand in extreme scenarios #5798

Merged
merged 8 commits into from
Mar 13, 2023

Conversation

hzh0425
Copy link
Member

@hzh0425 hzh0425 commented Jan 1, 2023

… missing messages

Make sure set the target branch to develop

What is the purpose of the change

Close #5663

Brief changelog

Add a new state 'isSynchronizingSyncStateSet' in 'AutoSwitchHAService' to Solve the problem of missing messages

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.

@codecov-commenter
Copy link

codecov-commenter commented Jan 1, 2023

Codecov Report

Merging #5798 (e71b131) into develop (a1d1cf8) will decrease coverage by 0.05%.
The diff coverage is 85.71%.

@@              Coverage Diff              @@
##             develop    #5798      +/-   ##
=============================================
- Coverage      43.44%   43.40%   -0.05%     
- Complexity      8824     8832       +8     
=============================================
  Files           1090     1090              
  Lines          76617    76649      +32     
  Branches       10006    10010       +4     
=============================================
- Hits           33289    33266      -23     
- Misses         39166    39225      +59     
+ Partials        4162     4158       -4     
Impacted Files Coverage Δ
...ketmq/store/ha/autoswitch/AutoSwitchHAService.java 59.05% <85.71%> (+3.64%) ⬆️
.../apache/rocketmq/store/ha/io/AbstractHAReader.java 79.31% <0.00%> (-10.35%) ⬇️
...org/apache/rocketmq/common/stats/StatsItemSet.java 41.79% <0.00%> (-5.98%) ⬇️
...a/org/apache/rocketmq/broker/BrokerController.java 43.25% <0.00%> (-3.43%) ⬇️
...he/rocketmq/controller/impl/DLedgerController.java 66.49% <0.00%> (-2.62%) ⬇️
...pl/consumer/ConsumeMessageConcurrentlyService.java 46.60% <0.00%> (-2.27%) ⬇️
...cketmq/store/ha/autoswitch/AutoSwitchHAClient.java 74.00% <0.00%> (-2.17%) ⬇️
.../apache/rocketmq/controller/ControllerManager.java 71.87% <0.00%> (-2.09%) ⬇️
...he/rocketmq/broker/processor/PopReviveService.java 39.41% <0.00%> (-1.35%) ⬇️
...he/rocketmq/client/impl/consumer/ProcessQueue.java 60.79% <0.00%> (-0.45%) ⬇️
... and 8 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

# Conflicts:
#	store/src/main/java/org/apache/rocketmq/store/ha/autoswitch/AutoSwitchHAService.java
@RongtongJin RongtongJin changed the title [ISSUE #5663] FIx Messages may be lost when SyncStateSet expand in extreme scenarios [ISSUE #5663] Fix Messages may be lost when SyncStateSet expand in extreme scenarios Jan 6, 2023
@hzh0425
Copy link
Member Author

hzh0425 commented Jan 12, 2023

@RongtongJin PTLA

@RongtongJin
Copy link
Contributor

RongtongJin commented Feb 3, 2023

Hi @hzh0425 Could you help reslove the conflict?

# Conflicts:
#	store/src/test/java/org/apache/rocketmq/store/ha/autoswitch/AutoSwitchHATest.java
@RongtongJin RongtongJin added the module/ha high availably related label Feb 14, 2023
Copy link
Member

@TheR1sing3un TheR1sing3un left a comment

Choose a reason for hiding this comment

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

LGTM~

@RongtongJin RongtongJin merged commit 2cc899f into apache:develop Mar 13, 2023
fuyou001 pushed a commit to fuyou001/rocketmq that referenced this pull request Mar 16, 2023
… in extreme scenarios (apache#5798)

* Add a new state 'isSynchronizingSyncStateSet' to Solve the problem of missing messages

* pass checkstyle

* Using readWriteLock to replace synchronized in AutoSwitchHAService

* Fix lock issue

* Remove unnecessary 'remoteSyncStateSet.clear'

* optimize import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/ha high availably related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Messages may be lost when SyncStateSet expand in extreme scenarios
5 participants