Skip to content

Commit

Permalink
[ISSUE openmessaging#316] fix committedIndex after truncate
Browse files Browse the repository at this point in the history
  • Loading branch information
yuz10 authored Feb 22, 2024
1 parent d34f270 commit c89b06d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ public long truncate(DLedgerEntry entry, long leaderTerm, String leaderId) {
PreConditions.check(indexPos == entry.getIndex() * INDEX_UNIT_SIZE, DLedgerResponseCode.DISK_ERROR, null);
ledgerEndTerm = entry.getTerm();
ledgerEndIndex = entry.getIndex();
if (committedIndex > ledgerEndIndex) {
committedIndex = ledgerEndIndex;
}
reviseLedgerBeforeBeginIndex();
updateLedgerEndIndexAndTerm();
return entry.getIndex();
Expand Down

0 comments on commit c89b06d

Please sign in to comment.