Skip to content

CASSANDRA-16772: Support multiple SSTables per table in user defined cleanup - #5153

Open
cheeeee wants to merge 1 commit into
apache:trunkfrom
cheeeee:CASSANDRA-16772-trunk
Open

CASSANDRA-16772: Support multiple SSTables per table in user defined cleanup#5153
cheeeee wants to merge 1 commit into
apache:trunkfrom
cheeeee:CASSANDRA-16772-trunk

Conversation

@cheeeee

@cheeeee cheeeee commented Sep 10, 2026

Copy link
Copy Markdown

Status: changes requested — not ready to merge

The added regression test passes with the original single-descriptor bug and does not prove both requested SSTables were processed.

Verification correction

Earlier descriptions overstated correctness and/or test coverage. Those claims are withdrawn. AI-assisted source review has been performed; this is not maintainer approval. Previously mixed build artifacts are not accepted as verification evidence. Corrective changes and clean, targeted verification are in progress; the published head has not yet been replaced.

Published head under review: 6d6faad940826115944ad55c3a42b85920ddd143.

…A-16772)

In CompactionManager.forceUserDefinedCleanup(), descriptors were grouped
using a HashMap<ColumnFamilyStore, Descriptor>. When a user passed multiple
SSTables for the same table (e.g. nodetool cleanup -u /data/file1.db /data/file2.db),
descriptors.put(cfs, desc) overwrote earlier descriptors with the same key,
silently discarding all but the last SSTable.

This patch:
1. Replaces the custom loop and HashMap with Descriptor.fromFilenamesGrouped(),
   aligning forceUserDefinedCleanup() with forceUserDefinedCompaction().
2. Iterates over descriptors.get(cfs), ensuring all user-specified SSTables
   are cleaned.
3. Guards against concurrent compactions by checking for null LifecycleTransaction,
   logging a warning and safely continuing to process the remaining sstables.
4. Adds UserDefinedCleanupMultipleSSTablesTest verifying that all passed
   SSTables are processed.

Fixes: CASSANDRA-16772
@cheeeee
cheeeee force-pushed the CASSANDRA-16772-trunk branch from 49eafc2 to 6d6faad Compare September 11, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant