fix: run alignAcknowledgeStatus for every flushed entry, not just the last one - #26305
Open
waterWang wants to merge 1 commit into
Open
fix: run alignAcknowledgeStatus for every flushed entry, not just the last one#26305waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
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.
Motivation
When a durable cursor reset and a mark-delete (individual ack) are enqueued together in
pendingMarkDeleteOpswhilePENDING_READ_OPS > 0,internalFlushPendingMarkDeletespicks only the last entry and persists it. On persist completion, only the last entry'salignAcknowledgeStatus()runs — so the earlier entry's state mutation is silently dropped, even thoughtriggerComplete()fans out the callbacks, making the reset report success while the cursor never moved.Root Cause
Since #25047, the cursor reset's state mutation lives in a per-
MarkDeleteEntryrunnable (alignAcknowledgeStatusAfterPersisted), not in the reset's completion callback. When two entries are flushed together:internalFlushPendingMarkDeletescallspendingMarkDeleteOps.getLast()-> AalignAcknowledgeStatus()runstriggerComplete()still fires the reset callback -> success is reportedFix
In the persist completion callback, when
mdEntry.callbackGroupis set (meaning multiple entries were flushed together), iterate the group and callalignAcknowledgeStatus()on every entry, not just the last one. This ensures that each request's in-memory state mutation is applied, while the persist position still comes from the last entry.Testing
The existing test suite covers the basic reset and mark-delete paths. A targeted test for the displacement scenario (reset + ack queued, ack flushed last) is tracked in the issue's reproduction sketch.
Issue
Closes #26304