You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "fujian-zfj (via GitHub)" <gi...@apache.org> on 2023/03/30 04:37:33 UTC

[GitHub] [rocketmq] fujian-zfj opened a new pull request, #6509: Prohibit writing and reading before confirming the broker role in ha mode

fujian-zfj opened a new pull request, #6509:
URL: https://github.com/apache/rocketmq/pull/6509

   **Make sure set the target branch to `develop`**
   
   ## What is the purpose of the change
   
   
   fix #6508
   
   ## Brief changelog
   
   Please describe the issue you observed:
   I notice a bug in the following case.
   
   start two broker, one acting as master(node1), the other acting as slave(node2)
   first kill node1, then node2 will change to master
   right after node2 changing to master(node2 has not register to namesrv), kill node2
   then client send messages(msg1 to msg100) to topic1 and subscribe topic1 successfully
   two minutes later, node1 start, due to node1 is not in syncStateSet, it can not be elected as master
   ten minutes later, node2 start and is elected as master, then node1 change to slave and truncate dirty message (msg1 to msg100)
   In step 4, the reason that client can successfully send message to node1 is that namesrv still think the master is node1.
   
   So wh should prohibit writing and reading before confirming the broker role in ha mode
   
   ## 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`.
   
   - [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) 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. 
   - [x] 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.
   - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [x] 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](https://github.com/apache/rocketmq/tree/master/test).
   - [x] 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](http://www.apache.org/licenses/#clas).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] github-code-scanning[bot] commented on pull request #6509: [ISSUE #6508]Prohibit writing and reading before confirming the broker role in ha mode

Posted by "github-code-scanning[bot] (via GitHub)" <gi...@apache.org>.
github-code-scanning[bot] commented on PR #6509:
URL: https://github.com/apache/rocketmq/pull/6509#issuecomment-1489765967

   You have successfully added a new CodeQL configuration `.github/workflows/codeql_analysis.yml:CodeQL-Build`. As part of the setup process, we have scanned this repository and found 9 existing alerts. Please check the repository [Security tab](/apache/rocketmq/security/code-scanning?query=pr%3A6509+tool%3ACodeQL+is%3Aopen) to see all alerts.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] codecov-commenter commented on pull request #6509: [ISSUE #6508]Prohibit writing and reading before confirming the broker role in ha mode

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #6509:
URL: https://github.com/apache/rocketmq/pull/6509#issuecomment-1489746125

   ## [Codecov](https://codecov.io/gh/apache/rocketmq/pull/6509?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#6509](https://codecov.io/gh/apache/rocketmq/pull/6509?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1c3b35f) into [develop](https://codecov.io/gh/apache/rocketmq/commit/24bc8c90923b762be5d1d74da6bc1b27447ebce4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (24bc8c9) will **increase** coverage by `0.02%`.
   > The diff coverage is `33.33%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #6509      +/-   ##
   =============================================
   + Coverage      43.16%   43.18%   +0.02%     
   - Complexity      9007     9019      +12     
   =============================================
     Files           1107     1107              
     Lines          78269    78273       +4     
     Branches       10202    10203       +1     
   =============================================
   + Hits           33782    33801      +19     
   + Misses         40248    40236      -12     
   + Partials        4239     4236       -3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/6509?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...a/org/apache/rocketmq/broker/BrokerController.java](https://codecov.io/gh/apache/rocketmq/pull/6509?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvQnJva2VyQ29udHJvbGxlci5qYXZh) | `43.54% <0.00%> (-0.13%)` | :arrow_down: |
   | [...he/rocketmq/broker/controller/ReplicasManager.java](https://codecov.io/gh/apache/rocketmq/pull/6509?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvY29udHJvbGxlci9SZXBsaWNhc01hbmFnZXIuamF2YQ==) | `45.90% <60.00%> (+0.12%)` | :arrow_up: |
   
   ... and [22 files with indirect coverage changes](https://codecov.io/gh/apache/rocketmq/pull/6509/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] RongtongJin merged pull request #6509: [ISSUE #6508]Prohibit writing and reading before confirming the broker role in ha mode

Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin merged PR #6509:
URL: https://github.com/apache/rocketmq/pull/6509


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org