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

CASSANDRA-16772: CompactionManager.forceUserDefinedCleanup groups the requested files in a
HashMap<ColumnFamilyStore, Descriptor>, so only the last file named for a table is cleaned and the
others are silently ignored.

Change: use Descriptor.fromFilenamesGrouped, which returns a Multimap and is what
forceUserDefinedCompaction already uses, and iterate all descriptors per table. A table that cannot be
locked for cleanup (tryModify returns null because it is being compacted) is skipped with a warning
instead of dereferencing the null transaction. The ring-join precondition moves ahead of filename
parsing. Unknown schema, inactive and unreadable files are still skipped and logged as before.

Testing:

  • UserDefinedCleanupMultipleSSTablesTest: a two-token ring where the local node owns three of six
    partitions, three SSTables each holding two partitions; cleanup is requested for two of them. Both
    requested originals are replaced by outputs that contain exactly their owned partition, and the
    unrequested SSTable is untouched. Without the change the first requested file is left as is.

CASSANDRA-16772

@cheeeee
cheeeee force-pushed the CASSANDRA-16772-trunk branch from 49eafc2 to 6d6faad Compare September 11, 2026 01:06
Group requested descriptors with Descriptor.fromFilenamesGrouped and clean
each active SSTable instead of retaining only the last descriptor per table.
Skip a descriptor when its SSTable cannot be acquired for cleanup.

Cover two requested SSTables containing owned and unowned partitions and
an unrequested third SSTable. Verify replacement of both requested originals,
removal of their unowned rows, and preservation of the unrequested data.

CASSANDRA-16772

Generated-by: Claude (Anthropic)
@cheeeee
cheeeee force-pushed the CASSANDRA-16772-trunk branch from 6d6faad to 55168db Compare September 11, 2026 22:51
@cheeeee cheeeee changed the title CASSANDRA-16772: Support multiple SSTables per table in user defined cleanup CASSANDRA-16772 Support multiple SSTables per table in user-defined cleanup Sep 11, 2026
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