Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ private void addMissingSnapshotYamlFiles(
}
OmSnapshotLocalData snapshotLocalData = new OmSnapshotLocalData(snapshotId, sstList,
snapshotInfo.getPathPreviousSnapshotId(), null);
// Set needsDefrag to true to indicate that the snapshot needs to be defragmented, since the snapshot has
// never been defragmented before.
snapshotLocalData.setNeedsDefrag(true);
snapshotLocalDataSerializer.save(snapshotLocalDataFile, snapshotLocalData);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,8 @@ public void testInitWithMissingYamlFiles(boolean needsUpgrade) throws IOExceptio
assertEquals(snapshotId, snapshotLocalData.getSnapshotId());
assertEquals(previousMap.get(snapshotId), snapshotLocalData.getPreviousSnapshotId());
assertEquals(expectedSstFile.get(snapshotId), snapshotLocalData.getVersionSstFileInfos());
assertTrue(readableOmSnapshotLocalDataProvider.needsDefrag());
assertTrue(snapshotLocalData.getNeedsDefrag());
}
}
} else {
Expand Down