disable compactions when global property is set#2280
Draft
scottfines wants to merge 3 commits intomainfrom
Draft
disable compactions when global property is set#2280scottfines wants to merge 3 commits intomainfrom
scottfines wants to merge 3 commits intomainfrom
Conversation
Checklist before you submit for review
|
|
… This also ensures that auto-compaciton logic is adhered to, and that the two system properties go well together.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.