Skip to content

Conversation

@Shawyeok
Copy link
Contributor

@Shawyeok Shawyeok commented Feb 2, 2026

Motivation

Fixes #20408

It's possible that the ledger at the mark-deleted position is empty and has been deleted already. This is not an error condition, so it should be logged at debug level instead of warn level to reduce noise in production logs.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

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: Shawyeok#25

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Feb 2, 2026
… ledger doesn't exist

It's possible that the ledger at the mark-deleted position is empty and has been deleted already. This is not an error condition, so it should be logged at debug level instead of warn level to reduce noise in production logs.

Fixes apache#20408
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oneby-wang
Copy link
Contributor

It's possible that the ledger at the mark-deleted position is empty and has been deleted already.

I'm wondering if the fix in this PR is reasonable: #25117. The goal is to keep the ledger data and the mark-deleted position consistent, thereby eliminating similar warning logs.

@Shawyeok
Copy link
Contributor Author

Shawyeok commented Feb 5, 2026

I'm wondering if the fix in this PR is reasonable: #25117. The goal is to keep the ledger data and the mark-deleted position consistent, thereby eliminating similar warning logs.

@oneby-wang

IMO, we should only change the mark-deleted position of a cursor when there's an actual user acknowledgment. Here's why:

  • If the mark-deleted position changes from 1000:-1 to 1100:-1 just to stay consistent with the managed ledger's ledger list, we lose visibility into whether any real acknowledgments occurred during that period. Keeping the mark-deleted position as-is preserves that information — we can tell that no messages were actually acknowledged.

  • I don't see a clear benefit from enforcing this consistency. The managed ledger's ledger list is a ConcurrentSkipListMap, which handles lookups for the lowest bound greater than the mark-deleted position just fine.

@lhotari lhotari merged commit 00a65e3 into apache:master Feb 6, 2026
54 of 55 checks passed
lhotari pushed a commit that referenced this pull request Feb 6, 2026
…k-deleted position ledger doesn't exist (#25200)

(cherry picked from commit 00a65e3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Mis-Leading log Cursor: xxx does not exist in the managed-ledger.

3 participants