You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/07/30 11:00:28 UTC

[GitHub] [rocketmq] RongtongJin opened a new pull request, #4733: [ISSUE #4732] Enable new timer message to adapt to ha switching and brokerContainer

RongtongJin opened a new pull request, #4733:
URL: https://github.com/apache/rocketmq/pull/4733

   **Make sure set the target branch to `develop`**
   
   ## What is the purpose of the change
   
   Enable new timer message to adapt to ha switching and brokerContainer
   
   ## Brief changelog
   
   Enable new timer message to adapt to ha switching and brokerContainer
   
   ## 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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] coveralls commented on pull request #4733: [ISSUE #4732] Enable new timer message to adapt to ha switching and brokerContainer

Posted by GitBox <gi...@apache.org>.
coveralls commented on PR #4733:
URL: https://github.com/apache/rocketmq/pull/4733#issuecomment-1200149428

   
   [![Coverage Status](https://coveralls.io/builds/51285677/badge)](https://coveralls.io/builds/51285677)
   
   Coverage decreased (-0.3%) to 48.825% when pulling **a9ab25439c11999ada286a495b1eb41801d41d14 on RongtongJin:develop-yy** into **975c232f3e5fc0b7f44ff5812af041360aa23421 on apache:develop**.
   


-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] zhouxinyu commented on a diff in pull request #4733: [ISSUE #4732] Make new timer message can adapt to HA and brokerContainer

Posted by GitBox <gi...@apache.org>.
zhouxinyu commented on code in PR #4733:
URL: https://github.com/apache/rocketmq/pull/4733#discussion_r933919452


##########
store/src/main/java/org/apache/rocketmq/store/timer/TimerMessageStore.java:
##########
@@ -503,7 +521,7 @@ private void checkBrokerRole() {
         BrokerRole currRole = storeConfig.getBrokerRole();

Review Comment:
   I found that although lastBrokerRole is protected by volatile, storeConfig.getBrokerRole is not. Considering the replicas manager will control the store config directly, there may be a visibility issue. 
   
   cc @GenerousMan 



-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] duhenglucky merged pull request #4733: [ISSUE #4732] Make new timer message can adapt to HA and brokerContainer

Posted by GitBox <gi...@apache.org>.
duhenglucky merged PR #4733:
URL: https://github.com/apache/rocketmq/pull/4733


-- 
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: dev-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 #4733: [ISSUE #4732] Enable new timer message to adapt to ha switching and brokerContainer

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #4733:
URL: https://github.com/apache/rocketmq/pull/4733#issuecomment-1200146158

   # [Codecov](https://codecov.io/gh/apache/rocketmq/pull/4733?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 [#4733](https://codecov.io/gh/apache/rocketmq/pull/4733?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a9ab254) into [develop](https://codecov.io/gh/apache/rocketmq/commit/67b49b55068e85551676a9af1f6cfa3776e41e08?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (67b49b5) will **decrease** coverage by `0.25%`.
   > The diff coverage is `29.89%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #4733      +/-   ##
   =============================================
   - Coverage      44.81%   44.56%   -0.26%     
   + Complexity      7560     7534      -26     
   =============================================
     Files            977      977              
     Lines          67640    67728      +88     
     Branches        8934     8957      +23     
   =============================================
   - Hits           30315    30184     -131     
   - Misses         33580    33794     +214     
   - Partials        3745     3750       +5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/4733?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ketmq/broker/dledger/DLedgerRoleChangeHandler.java](https://codecov.io/gh/apache/rocketmq/pull/4733/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvZGxlZGdlci9ETGVkZ2VyUm9sZUNoYW5nZUhhbmRsZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...org/apache/rocketmq/broker/out/BrokerOuterAPI.java](https://codecov.io/gh/apache/rocketmq/pull/4733/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvb3V0L0Jyb2tlck91dGVyQVBJLmphdmE=) | `18.72% <0.00%> (-0.54%)` | :arrow_down: |
   | [...apache/rocketmq/broker/slave/SlaveSynchronize.java](https://codecov.io/gh/apache/rocketmq/pull/4733/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvc2xhdmUvU2xhdmVTeW5jaHJvbml6ZS5qYXZh) | `4.51% <0.00%> (-1.10%)` | :arrow_down: |
   | [...g/apache/rocketmq/common/protocol/RequestCode.java](https://codecov.io/gh/apache/rocketmq/pull/4733/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vcHJvdG9jb2wvUmVxdWVzdENvZGUuamF2YQ==) | `0.00% <ø> (ø)` | |
   | [...he/rocketmq/broker/controller/ReplicasManager.java](https://codecov.io/gh/apache/rocketmq/pull/4733/diff?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.13% <16.66%> (-0.37%)` | :arrow_down: |
   | [...a/org/apache/rocketmq/broker/BrokerController.java](https://codecov.io/gh/apache/rocketmq/pull/4733/diff?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) | `44.59% <25.00%> (-2.69%)` | :arrow_down: |
   | [...apache/rocketmq/store/timer/TimerMessageStore.java](https://codecov.io/gh/apache/rocketmq/pull/4733/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL3RpbWVyL1RpbWVyTWVzc2FnZVN0b3JlLmphdmE=) | `54.06% <42.01%> (-1.01%)` | :arrow_down: |
   | [.../broker/subscription/SubscriptionGroupManager.java](https://codecov.io/gh/apache/rocketmq/pull/4733/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvc3Vic2NyaXB0aW9uL1N1YnNjcmlwdGlvbkdyb3VwTWFuYWdlci5qYXZh) | `68.79% <0.00%> (-14.19%)` | :arrow_down: |
   | [...n/java/org/apache/rocketmq/test/util/StatUtil.java](https://codecov.io/gh/apache/rocketmq/pull/4733/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-dGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvdGVzdC91dGlsL1N0YXRVdGlsLmphdmE=) | `16.19% <0.00%> (-14.09%)` | :arrow_down: |
   | [...va/org/apache/rocketmq/logging/inner/Appender.java](https://codecov.io/gh/apache/rocketmq/pull/4733/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bG9nZ2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbG9nZ2luZy9pbm5lci9BcHBlbmRlci5qYXZh) | `29.21% <0.00%> (-7.87%)` | :arrow_down: |
   | ... and [29 more](https://codecov.io/gh/apache/rocketmq/pull/4733/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] ShannonDing commented on a diff in pull request #4733: [ISSUE #4732] Make new timer message can adapt to HA and brokerContainer

Posted by GitBox <gi...@apache.org>.
ShannonDing commented on code in PR #4733:
URL: https://github.com/apache/rocketmq/pull/4733#discussion_r933832731


##########
broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java:
##########
@@ -625,12 +626,17 @@ public void run() {
                     @Override
                     public void run() {
                         try {
-                            BrokerController.this.slaveSynchronize.syncAll();
+                            if (System.currentTimeMillis() - lastSyncTimeMs > 60 * 1000) {
+                                BrokerController.this.getSlaveSynchronize().syncAll();
+                                lastSyncTimeMs = System.currentTimeMillis();
+                            }
+                            //timer checkpoint, latency-sensitive, so sync it more frequently
+                            BrokerController.this.getSlaveSynchronize().syncTimerCheckPoint();
                         } catch (Throwable e) {
                             LOG.error("Failed to sync all config for slave.", e);
                         }
                     }
-                }, 1000 * 10, 1000 * 60, TimeUnit.MILLISECONDS);
+                }, 1000 * 10, 3 * 1000, TimeUnit.MILLISECONDS);

Review Comment:
   Sync timer checkpoint every 3 seconds and syncAll every 60 seconds?



-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] RongtongJin commented on pull request #4733: [ISSUE #4732] Enable new timer message to adapt to ha switching and brokerContainer

Posted by GitBox <gi...@apache.org>.
RongtongJin commented on PR #4733:
URL: https://github.com/apache/rocketmq/pull/4733#issuecomment-1200140394

   @GenerousMan PTAL~
   


-- 
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: dev-unsubscribe@rocketmq.apache.org

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


[GitHub] [rocketmq] RongtongJin commented on a diff in pull request #4733: [ISSUE #4732] Make new timer message can adapt to HA and brokerContainer

Posted by GitBox <gi...@apache.org>.
RongtongJin commented on code in PR #4733:
URL: https://github.com/apache/rocketmq/pull/4733#discussion_r933915650


##########
broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java:
##########
@@ -625,12 +626,17 @@ public void run() {
                     @Override
                     public void run() {
                         try {
-                            BrokerController.this.slaveSynchronize.syncAll();
+                            if (System.currentTimeMillis() - lastSyncTimeMs > 60 * 1000) {
+                                BrokerController.this.getSlaveSynchronize().syncAll();
+                                lastSyncTimeMs = System.currentTimeMillis();
+                            }
+                            //timer checkpoint, latency-sensitive, so sync it more frequently
+                            BrokerController.this.getSlaveSynchronize().syncTimerCheckPoint();
                         } catch (Throwable e) {
                             LOG.error("Failed to sync all config for slave.", e);
                         }
                     }
-                }, 1000 * 10, 1000 * 60, TimeUnit.MILLISECONDS);
+                }, 1000 * 10, 3 * 1000, TimeUnit.MILLISECONDS);

Review Comment:
   Syncall is originally 60s, since timer checkpoint is latency-sensitive, sync it more frequently



-- 
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: dev-unsubscribe@rocketmq.apache.org

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