Skip to content

disable compactions when global property is set#2280

Draft
scottfines wants to merge 3 commits intomainfrom
cndb-17127
Draft

disable compactions when global property is set#2280
scottfines wants to merge 3 commits intomainfrom
cndb-17127

Conversation

@scottfines
Copy link

@scottfines scottfines commented Mar 19, 2026

What is the issue

In some environments, compaction is not desirable--it'll never actually run, so we don't want to initialize or manage the related resources (metrics, scheduled tasks, and so forth). In those situations, we want to be able to open a ColumnFamilyStore without initializing Compaction.

Unfortunately, Compaction logic is re-used in ancillary areas (like Schema reads), so we can't just not create the compaction logic. Instead, we need to basically shut it down immediately after creating it.

This manifests as excess resource usage in places like the RegionService, which can be seen in https://github.com/riptano/cndb/issues/17127

What does this PR fix and why was it fixed

This adds a system property to allow process-wide compaction disabling. when this flag is set, the compaction strategy is immediately shutdown after being reloaded. This (should) remove scheduled tasks, metrics, etc. and prevent compaction from using resources needlessly.

STRONG NOTE: I(the author) am not wholly convinced that this is the correct way to do this, and am very open to an alternative path. However, it was the only path that I could determine that did not involve massive changes to the entire codebase.

@github-actions
Copy link

Checklist before you submit for review

  • This PR adheres to the Definition of Done
  • Make sure there is a PR in the CNDB project updating the Converged Cassandra version
  • Use NoSpamLogger for log lines that may appear frequently in the logs
  • Verify test results on Butler
  • Test coverage for new/modified code is > 80%
  • Proper code formatting
  • Proper title for each commit staring with the project-issue number, like CNDB-1234
  • Each commit has a meaningful description
  • Each commit is not very long and contains related changes
  • Renames, moves and reformatting are in distinct commits
  • All new files should contain the DataStax copyright header instead of the Apache License one
@scottfines scottfines changed the title Cndb 17127 Shut down compaction when global property is set Mar 19, 2026
@scottfines scottfines marked this pull request as ready for review March 20, 2026 14:03
@scottfines scottfines changed the title Shut down compaction when global property is set disable compactions when global property is set Mar 20, 2026
@scottfines scottfines marked this pull request as draft March 20, 2026 15:01
… This also ensures that auto-compaciton logic is adhered to, and that the two system properties go well together.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants