[ISSUE #10276] Fix PopConsumerService changeInvisibilityDuration losing CK record when visibilityTimeout collision#10277
Open
qianye1001 wants to merge 4 commits intoapache:developfrom
Conversation
…n losing CK record when visibilityTimeout collision
lizhimins
reviewed
Apr 28, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #10277 +/- ##
=============================================
- Coverage 48.91% 48.87% -0.05%
+ Complexity 13455 13438 -17
=============================================
Files 1375 1375
Lines 100448 100450 +2
Branches 12971 12973 +2
=============================================
- Hits 49137 49092 -45
- Misses 45308 45345 +37
- Partials 6003 6013 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
lizhimins
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Issue(s) This PR Fixes
Brief Description
In
PopConsumerService.changeInvisibilityDuration, the RocksDB key is composed ofvisibilityTimeout + groupId + topicId + queueId + offset, wherevisibilityTimeout = popTime + invisibleTime.When the new CK's
changedPopTime + changedInvisibleTimeequals the old CK'spopTime + 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
visibilityTimeoutas 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?