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 04:46:22 UTC

[GitHub] [rocketmq] cserwen opened a new issue #3503: [POP] Restart Broker may will cause that consumer consumes from first

cserwen opened a new issue #3503:
URL: https://github.com/apache/rocketmq/issues/3503


   
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   - What did you do (The steps to reproduce)?
   Restart the broker when consumer is running
   
   - What did you expect to see?
   The consumer continues to consume from the last offset
   
   - What did you see instead?
   - It consumed from 0
   
   2. Please tell us about your environment:
   Linux
   
   3. Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
   ```log
   2021-11-17 20:16:12 WARN PullMessageThread_21 - Pop initial offset, because store is no correct, pop-1@consumer@3, 5384577->null
   2021-11-17 20:16:12 WARN PullMessageThread_69 - Pop initial offset, because store is no correct, pop-1@consumer@2, 5384587->null
   2021-11-17 20:16:12 WARN PullMessageThread_3 - Pop initial offset, because store is no correct, pop-1@consumer@0, 26128469->null
   2021-11-17 20:16:12 WARN PullMessageThread_31 - Pop initial offset, because store is no correct, pop-1@consumer@1, 12384558->null
   2021-11-17 20:16:12 WARN PullMessageThread_78 - Pop initial offset, because store is no correct, %RETRY%consumer_pop-1@consumer@0, 143690->null
   ```
   `getMessage()` will return null when:
   ```java
   public GetMessageResult getMessage(final String group, final String topic, final int queueId, final long offset,
           final int maxMsgNums,
           final MessageFilter messageFilter) {
           if (this.shutdown) {
               log.warn("message store has shutdown, so getMessage is forbidden");
               return null;
           }
   
           if (!this.runningFlags.isReadable()) {
               log.warn("message store is not readable, so getMessage is forbidden " + this.runningFlags.getFlagBits());
               return null;
           }
           ...
   ```
   I think that the offset should not be set as 0 when this method return null.
   https://github.com/apache/rocketmq/blob/4506f34e24714ec4d6ac37babd8f096632fd6b1c/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java#L526


-- 
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 closed issue #3503: [POP] Restart Broker may will cause that consumer consumes from first

Posted by GitBox <gi...@apache.org>.
odbozhou closed issue #3503:
URL: https://github.com/apache/rocketmq/issues/3503


   


-- 
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 issue #3503: [POP] Restart Broker may will cause that consumer consumes from first

Posted by GitBox <gi...@apache.org>.
cserwen commented on issue #3503:
URL: https://github.com/apache/rocketmq/issues/3503#issuecomment-1071940138


   @lizhiboo  @RongtongJin @duhenglucky  Hello, can this pr be merged?


-- 
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 issue #3503: [POP] Restart Broker may will cause that consumer consumes from first

Posted by GitBox <gi...@apache.org>.
cserwen commented on issue #3503:
URL: https://github.com/apache/rocketmq/issues/3503#issuecomment-1071940138


   @lizhiboo  @RongtongJin @duhenglucky  Hello, can this pr be merged?


-- 
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 issue #3503: [POP] Restart Broker may will cause that consumer consumes from first

Posted by GitBox <gi...@apache.org>.
odbozhou commented on issue #3503:
URL: https://github.com/apache/rocketmq/issues/3503#issuecomment-1071974591


   merged


-- 
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 issue #3503: [POP] Restart Broker may will cause that consumer consumes from first

Posted by GitBox <gi...@apache.org>.
odbozhou commented on issue #3503:
URL: https://github.com/apache/rocketmq/issues/3503#issuecomment-1071974591


   merged


-- 
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 closed issue #3503: [POP] Restart Broker may will cause that consumer consumes from first

Posted by GitBox <gi...@apache.org>.
odbozhou closed issue #3503:
URL: https://github.com/apache/rocketmq/issues/3503


   


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