CASSANDRA-20081: Add compaction type and strategy properties to compaction history #4540
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.
Currently,
nodetool compactionhistorydoes not provide visibility into the specific type of compaction (e.g., Major, Minor, Validation) or the compaction strategy used (e.g., STCS, LCS). Additionally, the output displays raw bytes by default, which is difficult to read.This patch enhances the compaction history by persisting the compaction type and strategy properties into the
system.compaction_historytable and exposing them vianodetool.Changes included in this patch:
compaction_typecolumn tosystem.compaction_history.CompactionTaskto capture the compaction type (e.g., Major, Cleanup) and strategy class (e.g., SizeTieredCompactionStrategy) and persist them.CompactionHistoryTabularDataandnodetool compactionhistoryprinter to display these new fields.nodetool compactionhistoryto display human-readable sizes (KiB, MiB) by default. Added a-n/--no-human-readableflag to revert to raw bytes.SystemKeyspaceTest,CompactionTaskTest, andCompactionHistoryTestto cover schema changes and verify the persistence of new fields.Tests Performed:
ant test -Dtest.name=SystemKeyspaceTest(PASSED)ant test -Dtest.name=CompactionTaskTest(PASSED)ant test -Dtest.name=CompactionHistoryTest(PASSED)nodetool compactionhistoryon a local node.patch by arvindKandpal-ksolves ; for CASSANDRA-20081