Skip to content

CASSANDRA-21527: Make runWithCompactionsDisabled return non-null on success - #4948

Open
nivykani wants to merge 4 commits into
apache:trunkfrom
nivykani:truncate
Open

CASSANDRA-21527: Make runWithCompactionsDisabled return non-null on success#4948
nivykani wants to merge 4 commits into
apache:trunkfrom
nivykani:truncate

Conversation

@nivykani

Copy link
Copy Markdown

Currently, runWithCompactionsDisabled can’t tell the difference between a successful truncate vs a truncate that wasn’t successful due to being unable to stop compaction, because both return null. In either case, it logs “Truncate is complete” and returns success to the user. TruncateBlockingTest reproduces this bug.

The proposed fix is adding a return value to check for success on truncateBlocking, as well as adding a new exception type for Truncate.

The Cassandra Jira

@nivykani
nivykani force-pushed the truncate branch 2 times, most recently from 64ae491 to 905c729 Compare July 21, 2026 23:57
Fix flaky test to wait for the index

Formatting

Fix test

Fix test
try
{
// submitMaximal should no-op on null getMaximalTasks result
var futures = CompactionManager.instance.submitMaximal(cfs, false, -1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nivykani could you please change var to a concrete type, you will most probably hit this when trying to backport this to lower branches anyway.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by inlining, since futures is only used once anyway.

@nivykani
nivykani requested a review from smiklosovic August 4, 2026 17:07
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.

2 participants