Skip to content

Conversation

@oneby-wang
Copy link
Contributor

@oneby-wang oneby-wang commented Dec 24, 2025

Motivation

We do mark delete operations in ManagedLedgerImpl.maybeUpdateCursorBeforeTrimmingConsumedLedger() after #25087.

Mark deleting an already mark-deleted position will throw an Exception.

Please see comment for race condition case: #25101 (comment).

See also:

  1. [fix][test] Fix ManagedCursorTest and NonDurableCursorTest flaky tests #25101
  2. [fix][test] Fix ManagedCursorTest and NonDurableCursorTest flaky tests #25101 (comment)

Modifications

  1. Snapshot cursor.getMarkDeletedPosition() into a local variable to avoid race condition.
  2. Add warn log when lastAckedPosition < markDeletedPosition.
  3. Modify some typo, add one TODO.

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

Matching PR in forked repository

PR in forked repository: oneby-wang#18

@github-actions
Copy link

@oneby-wang Please add the following content to your PR description and select a checkbox:

- [ ] `doc` <!-- Your PR contains doc changes -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->

@oneby-wang oneby-wang marked this pull request as draft December 24, 2025 01:58
@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Dec 24, 2025
@oneby-wang oneby-wang force-pushed the maybeUpdateCursorBeforeTrimmingConsumedLedger_mark_delete branch from eed610c to 3f77d84 Compare December 24, 2025 02:27
@oneby-wang oneby-wang force-pushed the maybeUpdateCursorBeforeTrimmingConsumedLedger_mark_delete branch from f0619ec to 3de1d97 Compare December 25, 2025 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant