redlsz opened a new issue, #7724:
URL: https://github.com/apache/rocketmq/issues/7724

   ### Before Creating the Bug Report
   
   - [X] I found a bug, not just asking a question, which should be created in 
[GitHub Discussions](https://github.com/apache/rocketmq/discussions).
   
   - [X] I have searched the [GitHub 
Issues](https://github.com/apache/rocketmq/issues) and [GitHub 
Discussions](https://github.com/apache/rocketmq/discussions)  of this 
repository and believe that this is not a duplicate.
   
   - [X] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   
   ### Runtime platform environment
   
   centos7
   
   ### RocketMQ version
   
   5.1.0
   
   ### JDK Version
   
   JDK 1.8
   
   ### Describe the Bug
   
   A message is popped up again after being acknowledged, even appears twice at 
the same time. No offset-reset or service-reboot.
   
   queryMsgByOffset results:
   
   <img width="628" alt="image" 
src="https://github.com/apache/rocketmq/assets/103550934/bfcb7d91-6a48-458d-9962-e36a46dc8fa5";>
   
   It can be noticed that broker store two identical messages (same UNIQ_KEY) 
to pop-retry topic at the same time. And this message has actually been 
acknowledged before.
   
   After reviewing the codes, we have a suspicion about the _reviveMsgFromCk_: 
   When revive a message from a PopCheckPoint, the original message should be 
read out from store firstly. But what the _getBizMessage_ actual does is 
reading one message **starting from** the specified queue offset, instead of 
message **of** the specified queue offset. In other words, incorrect message 
may be read out and revived in some scenarios.
   
   (In addition, although the pop-time-check may avoids the above issue to some 
extent, we should ensure that a message's pop-time will never be less than its 
store-time.)
   
   <img width="1530" alt="image" 
src="https://github.com/apache/rocketmq/assets/103550934/2fbb1314-c649-4fe9-924e-3a6f8706fef0";>
   
   
   ### Steps to Reproduce
   
   A possible case:
   
   message in queue:
   
   m0(storeTime=t0,commitlogfile0), m1(storeTime=t1,commitlogfile1)
   
   
   timeline:
   
   t2 -> Pop m0 (donnot ack)
   
   t3 -> commitlogfile0 is expired and deleted
   
   t4 -> invisible timeout and try revive m0, but the actual read and revived 
messag is m1
   
   
   (t0<t1<t2<t3<t4)
   
   ### What Did You Expect to See?
   
   Message will not be received again after being acknowledged.
   
   ### What Did You See Instead?
   
   Message is received again after being acknowledged.
   
   ### Additional Context
   
   _No response_


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to