Skip to content

Commit

Permalink
fix(atomix): compact all index when reseting the segments
Browse files Browse the repository at this point in the history
(cherry picked from commit 9662c05)
  • Loading branch information
deepthidevaki committed Feb 10, 2021
1 parent 00f7ead commit a84e429
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public void commit(final long index) {
@Override
public void reset(final long index) {
if (index > currentSegment.index()) {
// delete all index mapping
currentSegment.compactIndex(index + 1);
// delete all segments and create an empty one
currentSegment = journal.resetSegments(index);
currentWriter = currentSegment.writer();
} else {
Expand Down

0 comments on commit a84e429

Please sign in to comment.