You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Paulo Motta (JIRA)" <ji...@apache.org> on 2015/11/26 15:00:13 UTC
[jira] [Updated] (CASSANDRA-7290) Compaction strategy is not
reloaded when compaction strategy options is updated
[ https://issues.apache.org/jira/browse/CASSANDRA-7290?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paulo Motta updated CASSANDRA-7290:
-----------------------------------
Component/s: Compaction
> Compaction strategy is not reloaded when compaction strategy options is updated
> -------------------------------------------------------------------------------
>
> Key: CASSANDRA-7290
> URL: https://issues.apache.org/jira/browse/CASSANDRA-7290
> Project: Cassandra
> Issue Type: Bug
> Components: Compaction
> Reporter: Paulo Motta
> Assignee: Paulo Motta
> Fix For: 2.0.9
>
>
> The AbstractCompactionStrategy constructor receives an options map on its constructor:
> {code:java}
> protected AbstractCompactionStrategy(ColumnFamilyStore cfs, Map<String, String> options)
> {
> assert cfs != null;
> this.cfs = cfs;
> this.options = options;
> ...
> {code}
> This map is currently the same reference as CFMetadata.compactionStrategyOptions, so ColumnFamilyStore.reload() does not reload the compaction strategy when a compaction strategy option changes:
> {code:java}
> private void maybeReloadCompactionStrategy()
> {
> // Check if there is a need for reloading
> if (metadata.compactionStrategyClass.equals(compactionStrategy.getClass())
> && metadata.compactionStrategyOptions.equals(compactionStrategy.options)) //metadata.compactionStrategyOptions == compactionStrategy.options, so compaction is never reloaded
> return;
> {code}
> I spotted this in my test, when I tried changing the value of "unchecked_tombstone_compaction" from false to true and calling ColumnFamilyStore.reload() was not reloading the compaction strategy. I don't know if ColumnFamilyStore.reload() is only called during tests, or also whenever the schema changes.
> In order to fix the bug, I made AbstractCompactionStrategy.options an ImmutableMap, so if CFMetadata.compactionStrategyOptions is updated, ColumnFamilyStore.maybeReloadCompactionStrategy will actually reload the compaction strategy:
> {code:java}
> protected AbstractCompactionStrategy(ColumnFamilyStore cfs, Map<String, String> options)
> {
> assert cfs != null;
> this.cfs = cfs;
> this.options = ImmutableMap.copyOf(options);
> ...
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)