Skip to content

Commit

Permalink
Fix ReplayIndex to delete all index segments on sequence reset.
Browse files Browse the repository at this point in the history
Previously, if any index segments had been updated, it would only delete
those. Now, it deletes all segments regardless of what has been touched.
  • Loading branch information
ZachBray committed Apr 2, 2024
1 parent ac2f5d4 commit ca81b5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,11 @@ void reset()

evictionHandler.onReset(fixSessionId);
deleteFile(headerFile);
for (final File segmentFile: segmentBufferFiles)

for (int segmentIndex = 0; segmentIndex < segmentCount; segmentIndex++)
{
if (segmentFile != null)
final File segmentFile = replayIndexSegmentFile(fixSessionId, segmentIndex);
if (segmentFile.exists())
{
deleteFile(segmentFile);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.agrona.concurrent.status.AtomicCounter;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.Mockito;

Expand Down Expand Up @@ -442,7 +441,6 @@ public void shouldDeleteIndexSegmentsOnSequenceResetWhenNoSegmentsHaveBeenTouche
}

@Test(timeout = 20_000L)
@Ignore
public void shouldDeleteIndexSegmentsOnSequenceResetWhenASegmentHasBeenTouched()
{
int seqNo = 1;
Expand Down

0 comments on commit ca81b5f

Please sign in to comment.