Skip to content

Commit

Permalink
Reapply "Delete segmentLog from small to large"
Browse files Browse the repository at this point in the history
This reverts commit cc0b057.
  • Loading branch information
133tosakarin committed Nov 9, 2024
1 parent 9b30e4d commit 4963025
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,10 @@ private PurgeLog(TruncationSegments segments) {
void execute() throws IOException {
if (segments.getToDelete() != null) {
try(UncheckedAutoCloseable ignored = raftLogMetrics.startPurgeTimer()) {
for (SegmentFileInfo fileInfo : segments.getToDelete()) {
final Path deleted = FileUtils.deleteFile(fileInfo.getFile(storage));
LOG.info("{}: Purged RaftLog segment: info={}, path={}", name, fileInfo, deleted);
SegmentFileInfo[] toDeletes = segments.getToDelete();
for (int i = toDeletes.length - 1; i >= 0; i--) {
final Path deleted = FileUtils.deleteFile(toDeletes[i].getFile(storage));
LOG.info("{}: Purged RaftLog segment: info={}, path={}", name, toDeletes[i], deleted);
}
}
}
Expand Down

0 comments on commit 4963025

Please sign in to comment.