[ https://issues.apache.org/jira/browse/CASSANDRA-14888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16976643#comment-16976643 ]
Chris Lohfink commented on CASSANDRA-14888: ------------------------------------------- You should to add a unit test to cover MVs as well as they have some conditionally registered metrics. There are utility methods to create the metrics and automatically deregister them on cleanup. All metrics with issues just skipped that and created the metrics manually. Really this does fix the issue, but by doing more manual cleanup. While this does fix the problem, I think we should change these metrics to register appropriately (which also may provide keyspace metrics) or clean up that mechanism up a bit to be easier (maybe using annotations, reflection or something?). We should try to enforce the registering and automatic cleanup or make it easier and more obvious instead of setting a further precedence to do it manually. In the past the "wall of removeMetric" calls in {{release}} was never kept in sync and while the junit should work, this actually isn't the first time a unit test like this has been made (3rd to my knowledge) and there are some "flakey" scenarios with dropping tables, and the test actually doesn't capture everything (although we can improve that). This is the 4th (that I remember at least) time this issue came up, I think we should look at this in a bigger picture sense. That said if you are not interested or don't have bandwidth we could just patch this up a little here as it has definite value and have a follow up ticket to try to prevent the issue in future. > Several mbeans are not unregistered when dropping a keyspace and table > ---------------------------------------------------------------------- > > Key: CASSANDRA-14888 > URL: https://issues.apache.org/jira/browse/CASSANDRA-14888 > Project: Cassandra > Issue Type: Bug > Components: Observability/Metrics > Reporter: Ariel Weisberg > Assignee: Alex Deparvu > Priority: Urgent > Labels: patch-available > Fix For: 4.0, 4.0-rc > > Attachments: CASSANDRA-14888.patch > > > CasCommit, CasPrepare, CasPropose, ReadRepairRequests, > ShortReadProtectionRequests, AntiCompactionTime, BytesValidated, > PartitionsValidated, RepairPrepareTime, RepairSyncTime, > RepairedDataInconsistencies, ViewLockAcquireTime, ViewReadTime, > WriteFailedIdealCL > Basically for 3 years people haven't known what they are doing because the > entire thing is kind of obscure. Fix it and also add a dtest that detects if > any mbeans are left behind after dropping a table and keyspace. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org