Skip to content

[fix][broker] Fix ManagedLedgerImpl.advanceCursorsIfNecessary() method may lose non-durable cursor properties in race condition#32

Closed
oneby-wang wants to merge 6 commits into
masterfrom
advance_cursors_mark_delete_properties
Closed

[fix][broker] Fix ManagedLedgerImpl.advanceCursorsIfNecessary() method may lose non-durable cursor properties in race condition#32
oneby-wang wants to merge 6 commits into
masterfrom
advance_cursors_mark_delete_properties

Conversation

@oneby-wang

@oneby-wang oneby-wang commented May 16, 2026

Copy link
Copy Markdown
Owner

Motivation

This is a follow-up to apache#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 another markDelete() 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

  1. Add testAdvanceCursorsIfNecessaryNeverLoseProperties() test to reproduce the issue.
  2. Pass null to asyncMarkDelete() method properties param in advanceCursorsIfNecessary() method, so the cursor uses the latest properties when the mark-delete is applied.
  3. Run test to verify the code change.

Verifying this change

  • Make sure that the change passes the CI checks.

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@oneby-wang oneby-wang closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant