Conversation
…stable Also compare batchDeletedIndexes size to maxBatchDeletedIndexToPersist so dispatchers see non-persistable ACK state when batch records exceed the limit. Assisted-by: Cursor (Composer)
arimu1
force-pushed
the
fix/26499-isCursorDataFullyPersistable-batch-index
branch
from
September 12, 2026 13:24
8d00f5b to
6da992c
Compare
Contributor
|
One coordination note for future contributions: I opened #26499 and indicated that I was willing to submit a PR, although I had not opened one yet. In this situation, it would be helpful to leave a short comment before starting work, so contributors can avoid duplicating effort. No problem this time—just please coordinate on the issue first in similar cases. One change is required: the new I did not find another blocker in the current diff. |
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.
Fixes #26499
Motivation
ManagedCursorImpl.isCursorDataFullyPersistable()only compared the whole-entrydeletion range count to
maxUnackedRangesToPersist. When partial batch ACK stateexceeded
maxBatchDeletedIndexToPersist, the method still returnedtrueeventhough
buildBatchEntryDeletionIndexInfoList()truncates on persist. Thatmismatch can leave dispatchers running while some batch ACK records would not
survive a cursor-state write.
Modifications
isCursorDataFullyPersistable()to returnfalsewhenbatchDeletedIndexesexceedsmaxBatchDeletedIndexToPersist.ACK records with limit 2).
No change to PIP-299 dispatcher pause policy beyond making the persistability
check accurate.
Verifying this change
This change added tests and can be verified as follows:
./gradlew :managed-ledger:test --tests org.apache.bookkeeper.mledger.impl.ManagedCursorBatchAckRecoveryTest.testIsCursorDataFullyPersistableReflectsBatchDeletedIndexLimitDoes this pull request potentially affect one of the following parts: