Before Creating the Bug Report
Runtime platform environment
macOS (Darwin), reproduced with an isolated local unit test.
RocketMQ version
Branch: develop
Git commit: fd0c959
JDK Version
Zulu OpenJDK 8 (8.94.0.17)
Describe the Bug
ProcessQueue.putMessage assigns queueOffsetMax from each newly inserted message. When a batch is not ordered by queue offset, a lower offset processed last overwrites the real maximum. After the queue is drained, removeMessage therefore returns a stale next offset.
Steps to Reproduce
- Create a ProcessQueue.
- Insert two messages in one batch with queue offsets 10 and 5, in that order.
- Remove both messages.
- Observe that the returned next offset is 6.
What Did You Expect to See?
The returned next offset should be 11, one greater than the highest offset ever inserted.
What Did You See Instead?
The returned next offset is based on the last iterated message rather than the maximum queue offset.
Additional Context
The issue is deterministic and is covered by ProcessQueueTest.
Before Creating the Bug Report
Runtime platform environment
macOS (Darwin), reproduced with an isolated local unit test.
RocketMQ version
Branch: develop
Git commit: fd0c959
JDK Version
Zulu OpenJDK 8 (8.94.0.17)
Describe the Bug
ProcessQueue.putMessage assigns queueOffsetMax from each newly inserted message. When a batch is not ordered by queue offset, a lower offset processed last overwrites the real maximum. After the queue is drained, removeMessage therefore returns a stale next offset.
Steps to Reproduce
What Did You Expect to See?
The returned next offset should be 11, one greater than the highest offset ever inserted.
What Did You See Instead?
The returned next offset is based on the last iterated message rather than the maximum queue offset.
Additional Context
The issue is deterministic and is covered by ProcessQueueTest.