Before Creating the Bug Report
Runtime platform environment
All platforms
RocketMQ version
branch: develop
Describe the Bug
In PopConsumerService.changeInvisibilityDuration, the RocksDB key is composed of visibilityTimeout(8) + groupId + topicId + queueId + offset, where visibilityTimeout = popTime + invisibleTime.
When changedPopTime + changedInvisibleTime == popTime + invisibleTime (i.e., the new CK has the same visibilityTimeout as the old one), both ckRecord and ackRecord produce the same RocksDB key.
The current code flow:
writeRecords(ckRecord) — writes new CK (overwrites old record at same key)
deleteRecords(ackRecord) — deletes using the same key, which removes the newly written CK
This results in the message never being retried.
Steps to Reproduce
- Pop a message with popTime=1000, invisibleTime=5000 (visibilityTimeout=6000)
- Call changeInvisibilityDuration with changedPopTime=3000, changedInvisibleTime=3000 (visibilityTimeout=6000)
- The new CK and old CK have the same RocksDB key
- After writeRecords + deleteRecords, the CK record is lost
What Did You Expect to See?
The new CK record should persist in RocksDB so the message can be retried after the new invisibility timeout.
What Did You See Instead?
The new CK record is deleted because the delete operation uses the same key as the write, causing the message to never be retried.
Before Creating the Bug Report
Runtime platform environment
All platforms
RocketMQ version
branch: develop
Describe the Bug
In
PopConsumerService.changeInvisibilityDuration, the RocksDB key is composed ofvisibilityTimeout(8) + groupId + topicId + queueId + offset, wherevisibilityTimeout = popTime + invisibleTime.When
changedPopTime + changedInvisibleTime == popTime + invisibleTime(i.e., the new CK has the same visibilityTimeout as the old one), both ckRecord and ackRecord produce the same RocksDB key.The current code flow:
writeRecords(ckRecord)— writes new CK (overwrites old record at same key)deleteRecords(ackRecord)— deletes using the same key, which removes the newly written CKThis results in the message never being retried.
Steps to Reproduce
What Did You Expect to See?
The new CK record should persist in RocksDB so the message can be retried after the new invisibility timeout.
What Did You See Instead?
The new CK record is deleted because the delete operation uses the same key as the write, causing the message to never be retried.