[fix][broker] Fix ManagedLedgerImpl.advanceCursorsIfNecessary() method may lose non-durable cursor properties in race condition#25796
Merged
nodece merged 6 commits intoMay 18, 2026
Conversation
lhotari
approved these changes
May 18, 2026
Member
lhotari
left a comment
There was a problem hiding this comment.
LGTM, thanks for fixing @oneby-wang
nodece
approved these changes
May 18, 2026
Technoboy-
pushed a commit
that referenced
this pull request
May 20, 2026
…d may lose non-durable cursor properties in race condition (#25796)
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
This is a follow-up to #25165 for the same class of race condition, covering
ManagedLedgerImpl.advanceCursorsIfNecessary()and non-durable cursor properties.ManagedLedgerImpl.advanceCursorsIfNecessary()method may lose non-durable cursor mark-delete properties in a race condition.When
advanceCursorsIfNecessary()advances a non-durable cursor while anothermarkDelete()call with properties is in progress, passing the cursor current properties can capture stale properties and later overwrite the user-provided mark-delete properties.Modifications
testAdvanceCursorsIfNecessaryNeverLoseProperties()test to reproduce the issue.nulltoasyncMarkDelete()method properties param inadvanceCursorsIfNecessary()method, so the cursor uses the latest properties when the mark-delete is applied.Verifying this change
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: oneby-wang#32