qianye1001 opened a new pull request, #10277:
URL: https://github.com/apache/rocketmq/pull/10277

   ### Which Issue(s) This PR Fixes
   
   - Fixes #10276
   
   ### Brief Description
   
   In `PopConsumerService.changeInvisibilityDuration`, the RocksDB key is 
composed of `visibilityTimeout + groupId + topicId + queueId + offset`, where 
`visibilityTimeout = popTime + invisibleTime`.
   
   When the new CK's `changedPopTime + changedInvisibleTime` equals the old 
CK's `popTime + invisibleTime`, both records produce the same RocksDB key. The 
current code first writes the new CK (which overwrites the old record at the 
same key), then deletes using the old CK's key — which inadvertently removes 
the newly written record, causing the message to never be retried.
   
   **Fix:** Added a check before the delete operation. If the write was 
performed and the new CK has the same `visibilityTimeout` as the old one (same 
key), the delete is skipped since the write already replaced the old value in 
place.
   
   ### How Did You Test This Change?
   
   - Verified compilation passes successfully
   - Verified no new lint or compilation errors in the modified file
   - Logic analysis confirms correctness for all scenarios:
     1. Keys differ → write new CK + delete old CK (normal path)
     2. Keys same → write overwrites old record, skip delete (fix path)
     3. Group absent (skipWrite) → skip write + delete old CK (unchanged 
behavior)
   


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