Skip to content

Commit

Permalink
Skip ancestor deletion on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
wi11dey committed Sep 2, 2024
1 parent 3fb81de commit 9b25336
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -728,20 +728,20 @@ public static void removeUnfinishedCompactionLeftovers(CFMetaData metadata, Map<
}
}

// remove old sstables from compactions that did complete
for (Map.Entry<Descriptor, Set<Component>> sstableFiles : directories.sstableLister().list().entrySet())
{
Descriptor desc = sstableFiles.getKey();
if (completedAncestors.contains(desc.generation))
{
// if any of the ancestors were participating in a compaction, finish that compaction
logger.info("Going to delete leftover compaction ancestor {}", desc);
SSTable.delete(desc, sstableFiles.getValue());
UUID compactionTaskID = unfinishedCompactions.get(desc.generation);
if (compactionTaskID != null)
SystemKeyspace.finishCompaction(unfinishedCompactions.get(desc.generation));
}
}
// remove3 old sstables from compactions that did complete
// for (Map.Entry<Descriptor, Set<Component>> sstableFiles : directories.sstableLister().list().entrySet())
// {
// Descriptor desc = sstableFiles.getKey();
// if (completedAncestors.contains(desc.generation))
// {
// // if any of the ancestors were participating in a compaction, finish that compaction
// logger.info("Going to delete leftover compaction ancestor {}", desc);
// SSTable.delete(desc, sstableFiles.getValue());
// UUID compactionTaskID = unfinishedCompactions.get(desc.generation);
// if (compactionTaskID != null)
// SystemKeyspace.finishCompaction(unfinishedCompactions.get(desc.generation));
// }
// }
}

/**
Expand Down

0 comments on commit 9b25336

Please sign in to comment.