[ https://issues.apache.org/jira/browse/CASSANDRA-13142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16011835#comment-16011835 ]
Marcus Eriksson commented on CASSANDRA-13142: --------------------------------------------- this idea makes sense to me, a few comments; * We should probably interrupt all compactions if the user runs "upgradesstables -a" * Maybe we should block until the running compactions are finished? An operator might expect all sstables to be upgraded after running upgradesstables but that might not be true after this patch. We would probably need to keep track of the compaction-futures and get a 'snapshot' of the interesting ones (for the current table) when upgradesstables start, and then, when upgradesstables is finished, we wait for the futures in the snapshot to finish. * [this|https://github.com/instaclustr/cassandra/blob/18570092324f6ab6bace9d3ce3673f59e7d10d7b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java#L2872-L2878] will always return null if we don't cancel the ongoing compactions ({{getCompacting()}} will not be empty) - I guess we need to compare with which compactions we expect to be cancelled? * {{cfs.markAllCompacting()}} will fail if we don't actually cancel all ongoing compactions * [this|https://github.com/instaclustr/cassandra/blob/18570092324f6ab6bace9d3ce3673f59e7d10d7b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java#L2900-L2907] looks like it will only cancel validation compaction (if that parameter is set), nothing else. * [this|https://github.com/instaclustr/cassandra/blob/18570092324f6ab6bace9d3ce3673f59e7d10d7b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java#L1748-L1754] will also only ever cancel validation compaction (ie, it calls {{interruptCompactionFor}} with an empty list) * [this|https://github.com/instaclustr/cassandra/blob/18570092324f6ab6bace9d3ce3673f59e7d10d7b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java#L1751] creates a new list and calls {{.add}} on it - this returns {{true}}, not the new list, so it will recurse forever > Upgradesstables cancels compactions unnecessarily > ------------------------------------------------- > > Key: CASSANDRA-13142 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13142 > Project: Cassandra > Issue Type: Bug > Reporter: Kurt Greaves > Assignee: Kurt Greaves > Attachments: 13142-v1.patch > > > Since at least 1.2 upgradesstables will cancel any compactions bar > validations when run. This was originally determined as a non-issue in > CASSANDRA-3430 however can be quite annoying (especially with STCS) as a > compaction will output the new version anyway. Furthermore, as per > CASSANDRA-12243 it also stops things like view builds and I assume secondary > index builds as well which is not ideal. > We should avoid cancelling compactions unnecessarily. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org