You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/12/21 09:47:40 UTC

[GitHub] [rocketmq] lybuestc opened a new issue, #5752: [code bug]resetOffsetByTime got the wrong offset

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

   1. Please describe the issue you observed:
   
   - What did you do (The steps to reproduce)?
   When the timestamp of the reset point is greater than the maximum timestamp stored, it will be reset to maxoffset - 1, but it should be reset to maxoffset 
   
   - What is expected to see?
   
   <img width="888" alt="image" src="https://user-images.githubusercontent.com/5714971/208869702-ffcd1054-07ea-4478-9502-2ff718f98151.png">
   
   
   - What did you see instead?
   
   <img width="1147" alt="image" src="https://user-images.githubusercontent.com/5714971/208869485-ff1c212e-385c-4c95-8684-0033417f0fef.png">
   
   2. Please tell us about your environment:
   
   3. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
   
   similar issue : https://github.com/apache/rocketmq/issues/2661
   
   This issue thinks that BufferUnderflowException will be thrown in the implementation of getOffsetInQueueByTime, so the maxoffset - 1 position is taken as the return value of getOffsetInQueueByTime, but I think this is an implementation problem. This implementation causes subsequent resetOffsetByTime to be implemented with "now" and "-1". Reset to the latest function, but business developers have no way to distinguish whether to specify the time or reset to the latest, and this patching method will make it difficult for readers to understand. The getOffsetInQueueByTime method can be implemented  without BufferUnderflowException by the following impl:
   
   <img width="786" alt="image" src="https://user-images.githubusercontent.com/5714971/208872851-d0d4eb14-fdd7-42e7-b527-8e198ef1b9d4.png">
   
   This fix will make getOffsetInQueueByTime conform to the semantics of "return the position greater than or equal to the specified timestamp"


-- 
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.apache.org

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


[GitHub] [rocketmq] lybuestc closed issue #5752: [code bug]resetOffsetByTime got the wrong offset

Posted by GitBox <gi...@apache.org>.
lybuestc closed issue #5752: [code bug]resetOffsetByTime got the wrong offset
URL: https://github.com/apache/rocketmq/issues/5752


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