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 2021/11/18 03:17:01 UTC

[GitHub] [rocketmq] cserwen opened a new pull request #3499: [ISSUE #3498]Make messages in reviveTopic more evenly written to different queues

cserwen opened a new pull request #3499:
URL: https://github.com/apache/rocketmq/pull/3499


   **Make sure set the target branch to `develop`**
   
   ## What is the purpose of the change
   
   #3498 
   
   ## Brief changelog
   
   Use polling to calculate queueId
   
   ## 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 #3499: [ISSUE #3498]Make messages in reviveTopic more evenly written to different queues

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


   
   [![Coverage Status](https://coveralls.io/builds/44357624/badge)](https://coveralls.io/builds/44357624)
   
   Coverage decreased (-0.07%) to 53.406% when pulling **504b690c0383568670d821b5856d5763de1c79ce on cserwen:5.0.0-alpha** into **4506f34e24714ec4d6ac37babd8f096632fd6b1c on apache:5.0.0-alpha**.
   


-- 
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] odbozhou commented on a change in pull request #3499: [ISSUE #3498] Make messages in reviveTopic more evenly written to different queues

Posted by GitBox <gi...@apache.org>.
odbozhou commented on a change in pull request #3499:
URL: https://github.com/apache/rocketmq/pull/3499#discussion_r751955059



##########
File path: broker/src/main/java/org/apache/rocketmq/broker/processor/PopMessageProcessor.java
##########
@@ -350,7 +353,7 @@ private RemotingCommand processRequest(final Channel channel, RemotingCommand re
         if (requestHeader.isOrder()) {
             reviveQid = KeyBuilder.POP_ORDER_REVIVE_QUEUE;
         } else {
-            reviveQid = randomQ % this.brokerController.getBrokerConfig().getReviveQueueNum();
+            reviveQid = Math.abs(ckMessageNumber.getAndIncrement() % this.brokerController.getBrokerConfig().getReviveQueueNum());

Review comment:
       Whether the range of AtomicInteger is a bit small, even if there is abs, it may return a negative number, and the message volume may be out of bounds if it is too large. Is AtomicLong or ThreadLocalRandom better?




-- 
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] cserwen commented on pull request #3499: [ISSUE #3498] Make messages in reviveTopic more evenly written to different queues

Posted by GitBox <gi...@apache.org>.
cserwen commented on pull request #3499:
URL: https://github.com/apache/rocketmq/pull/3499#issuecomment-1005442406


   > rocketmq-common: Too many files with unapproved license Can you deal with it ?
   
   @Git-Yang Ok, I will fix it in another pr firstly.


-- 
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] Git-Yang edited a comment on pull request #3499: [ISSUE #3498] Make messages in reviveTopic more evenly written to different queues

Posted by GitBox <gi...@apache.org>.
Git-Yang edited a comment on pull request #3499:
URL: https://github.com/apache/rocketmq/pull/3499#issuecomment-1005431878


   rocketmq-common: Too many files with unapproved license
   Can you deal with it ?


-- 
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] Git-Yang commented on pull request #3499: [ISSUE #3498] Make messages in reviveTopic more evenly written to different queues

Posted by GitBox <gi...@apache.org>.
Git-Yang commented on pull request #3499:
URL: https://github.com/apache/rocketmq/pull/3499#issuecomment-1005431878


   rocketmq-common: Too many files with unapproved license


-- 
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] cserwen commented on pull request #3499: [ISSUE #3498] Make messages in reviveTopic more evenly written to different queues

Posted by GitBox <gi...@apache.org>.
cserwen commented on pull request #3499:
URL: https://github.com/apache/rocketmq/pull/3499#issuecomment-1008590092


   @Git-Yang @duhenglucky @odbozhou  Can you help me to merge this pr? There seems to be no problem.


-- 
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] cserwen commented on a change in pull request #3499: [ISSUE #3498] Make messages in reviveTopic more evenly written to different queues

Posted by GitBox <gi...@apache.org>.
cserwen commented on a change in pull request #3499:
URL: https://github.com/apache/rocketmq/pull/3499#discussion_r751961114



##########
File path: broker/src/main/java/org/apache/rocketmq/broker/processor/PopMessageProcessor.java
##########
@@ -350,7 +353,7 @@ private RemotingCommand processRequest(final Channel channel, RemotingCommand re
         if (requestHeader.isOrder()) {
             reviveQid = KeyBuilder.POP_ORDER_REVIVE_QUEUE;
         } else {
-            reviveQid = randomQ % this.brokerController.getBrokerConfig().getReviveQueueNum();
+            reviveQid = Math.abs(ckMessageNumber.getAndIncrement() % this.brokerController.getBrokerConfig().getReviveQueueNum());

Review comment:
       I think atomicLong can be better and I will update it.




-- 
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 edited a comment on pull request #3499: [ISSUE #3498] Make messages in reviveTopic more evenly written to different queues

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #3499:
URL: https://github.com/apache/rocketmq/pull/3499#issuecomment-972497623


   
   [![Coverage Status](https://coveralls.io/builds/44361593/badge)](https://coveralls.io/builds/44361593)
   
   Coverage decreased (-0.03%) to 53.451% when pulling **ad72617b2e43864045ca289a9bc2123de43744eb on cserwen:5.0.0-alpha** into **4506f34e24714ec4d6ac37babd8f096632fd6b1c on apache:5.0.0-alpha**.
   


-- 
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] odbozhou merged pull request #3499: [ISSUE #3498] Make messages in reviveTopic more evenly written to different queues

Posted by GitBox <gi...@apache.org>.
odbozhou merged pull request #3499:
URL: https://github.com/apache/rocketmq/pull/3499


   


-- 
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