Skip to content

Commit

Permalink
delete stats before rename in case of crash
Browse files Browse the repository at this point in the history
  • Loading branch information
wi11dey committed Sep 5, 2024
1 parent c473f24 commit f3ac913
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -886,12 +886,12 @@ public synchronized int loadNewSSTablesWithCount(boolean assumeCfIsEmpty)
}
while (new File(newDescriptor.filenameFor(Component.DATA)).exists());

logger.info("Renaming new SSTable {} to {}", descriptor, newDescriptor);
SSTableWriter.rename(descriptor, newDescriptor, components);

logger.info("Removing Statistics.db for new SSTable {} to clear old ancestor metadata", newDescriptor);
FileUtils.delete(new File(newDescriptor.filenameFor(Component.STATS)));
components = Sets.difference(components, ImmutableSet.of(Component.STATS));

logger.info("Renaming new SSTable {} to {}", descriptor, newDescriptor);
SSTableWriter.rename(descriptor, newDescriptor, components);
}

SSTableReader reader;
Expand Down

0 comments on commit f3ac913

Please sign in to comment.