Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] [broker] Skip to persist cursor info if it failed by cursor closed #23615

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3206,6 +3206,13 @@ void persistPositionToLedger(final LedgerHandle lh, MarkDeleteEntry mdEntry, fin
mbean.addWriteCursorLedgerSize(data.length);
callback.operationComplete();
} else {
if (isClosed()) {
// After closed the cursor, the in-progress persistence task will get a
// BKException.Code.LedgerClosedException.
callback.operationFailed(new CursorAlreadyClosedException(String.format("%s %s skipped this"
+ " persistence, because the cursor already closed", ledger.getName(), name)));
return;
}
log.warn("[{}] Error updating cursor {} position {} in meta-ledger {}: {}", ledger.getName(), name,
position, lh1.getId(), BKException.getMessage(rc));
// If we've had a write error, the ledger will be automatically closed, we need to create a new one,
Expand Down
Loading