Skip to content

Commit

Permalink
[fix][broker] Skip to persist cursor info if it failed by cursor clos…
Browse files Browse the repository at this point in the history
…ed (#23615)
  • Loading branch information
poorbarcode authored Dec 31, 2024
1 parent 149b9f7 commit 9850605
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3254,6 +3254,13 @@ void persistPositionToLedger(final LedgerHandle lh, MarkDeleteEntry mdEntry, fin
mbean.addWriteCursorLedgerSize(data.length);
callback.operationComplete();
} else {
if (state == State.Closed) {
// 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

0 comments on commit 9850605

Please sign in to comment.