Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hangc0276 committed Feb 20, 2024
1 parent a1460e2 commit 4e623c2
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,9 @@ public void readComplete(int rc, LedgerHandle lh, Enumeration<LedgerEntry> seq,
LOG.error("BK error reading ledger entries: {} - {}",
startEntryId, endEntryId, BKException.create(rc));
onReadEntryFailureCallback.accept(lh.getId(), startEntryId);
ledgerFragmentMcb.processResult(rc, null, null);
for (int i = 0; i < entriesToReplicateCnt; i++) {
ledgerFragmentMcb.processResult(rc, null, null);
}
return;
}
long lastEntryId = startEntryId;
Expand Down Expand Up @@ -534,14 +536,15 @@ public void writeComplete(int rc, long ledgerId, long entryId, BookieId addr, Ob
}
toSend.release();
}
if (lastEntryId == endEntryId) {
ledgerFragmentMcb.processResult(BKException.Code.OK, null, null);
} else {
if (lastEntryId != endEntryId) {
try {
batchRecoverLedgerFragmentEntry(lastEntryId + 1, endEntryId, lh,
ledgerFragmentMcb, newBookies, onReadEntryFailureCallback);
} catch (InterruptedException e) {
ledgerFragmentMcb.processResult(BKException.Code.InterruptedException, null, null);
int remainingEntries = (int) (endEntryId - lastEntryId);
for (int i = 0; i < remainingEntries; i++) {
ledgerFragmentMcb.processResult(BKException.Code.InterruptedException, null, null);
}
}
}
}
Expand Down

0 comments on commit 4e623c2

Please sign in to comment.