Skip to content

Conversation

@arvindKandpal-ksolves
Copy link
Contributor

Currently, nodetool compactionhistory does 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_history table and exposing them via nodetool.

Changes included in this patch:

  1. Schema Update: Added compaction_type column to system.compaction_history.
  2. Logic Update: Updated CompactionTask to capture the compaction type (e.g., Major, Cleanup) and strategy class (e.g., SizeTieredCompactionStrategy) and persist them.
  3. JMX/Tooling: Updated CompactionHistoryTabularData and nodetool compactionhistory printer to display these new fields.
  4. UX Improvement: Changed nodetool compactionhistory to display human-readable sizes (KiB, MiB) by default. Added a -n / --no-human-readable flag to revert to raw bytes.
  5. Tests: Updated SystemKeyspaceTest, CompactionTaskTest, and CompactionHistoryTest to 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)
  • Manual verification using nodetool compactionhistory on a local node.

patch by arvindKandpal-ksolves ; for CASSANDRA-20081

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