arvindKandpal-ksolves opened a new pull request, #4540: URL: https://github.com/apache/cassandra/pull/4540
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 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

