-
Notifications
You must be signed in to change notification settings - Fork 3.8k
CASSANDRA-20081: Add compaction type and strategy properties to compaction history #4540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
jyothsnakonisa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left few comments.
test/unit/org/apache/cassandra/db/compaction/CompactionTaskTest.java
Outdated
Show resolved
Hide resolved
test/unit/org/apache/cassandra/db/compaction/CompactionTaskTest.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionHistoryTabularData.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionHistoryTabularData.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/db/compaction/CompactionHistoryTabularData.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please check SystemKeyspaceMigrator41.java? specifically migrateCompactionHistory() method. You might need to include compaction_type during migration.
src/java/org/apache/cassandra/tools/nodetool/CompactionHistory.java
Outdated
Show resolved
Hide resolved
21d8883 to
519ea81
Compare
|
@jyothsnakonisa Thanks for the review. I have addressed all your comments:
|
jyothsnakonisa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arvindKandpal-ksolves looks good to me mostly. Can you also run CI and update the report on the JIRA
|
Hi @jyothsnakonisa , thanks for the approval! Could you please tell me how I can trigger the CI and what need to update in JIRA , as I am contributing to the code segment in Cassandra first time ? |
|
Hi @arvindKandpal-ksolves @smiklosovic might be able to help you with that. I generally run it on my organization's infrastructure. Also, can you please get it reviewed by one more committer. I saw @Guoma commenting on the JIRA, please check with him if he can do a second review. |
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