Don't try to get sstables for non-repairing column families Patch by marcuse; reviewed by Paulo Motta for CASSANDRA-12077
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/9358e589 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9358e589 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9358e589 Branch: refs/heads/cassandra-2.2 Commit: 9358e589e292a2c851d069aebd36819f8e767f5b Parents: 3c8421a Author: Marcus Eriksson <marc...@apache.org> Authored: Thu Jun 23 09:46:00 2016 +0200 Committer: Marcus Eriksson <marc...@apache.org> Committed: Thu Jun 23 14:49:59 2016 +0200 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../org/apache/cassandra/service/ActiveRepairService.java | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/9358e589/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 03246ae..620568d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.1.15 + * Don't try to get sstables for non-repairing column families (CASSANDRA-12077) * Prevent select statements with clustering key > 64k (CASSANDRA-11882) * Avoid marking too many sstables as repaired (CASSANDRA-11696) * Fix clock skew corrupting other nodes with paxos (CASSANDRA-11991) http://git-wip-us.apache.org/repos/asf/cassandra/blob/9358e589/src/java/org/apache/cassandra/service/ActiveRepairService.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/service/ActiveRepairService.java b/src/java/org/apache/cassandra/service/ActiveRepairService.java index bab244d..4ca1e42 100644 --- a/src/java/org/apache/cassandra/service/ActiveRepairService.java +++ b/src/java/org/apache/cassandra/service/ActiveRepairService.java @@ -528,7 +528,10 @@ public class ActiveRepairService implements IEndpointStateChangeSubscriber, IFai { assert marked.contains(cfId); ImmutableMap.Builder<SSTableReader, Ref<SSTableReader>> references = ImmutableMap.builder(); - for (SSTableReader sstable : getActiveSSTables(cfId)) + Iterable<SSTableReader> sstables = getActiveSSTables(cfId); + if (sstables == null) + throw new RuntimeException("Not possible to get sstables for anticompaction for " + cfId); + for (SSTableReader sstable : sstables) { Ref<SSTableReader> ref = sstable.tryRef(); if (ref == null) @@ -567,6 +570,9 @@ public class ActiveRepairService implements IEndpointStateChangeSubscriber, IFai { if (failed) return Collections.emptySet(); + if (!columnFamilyStores.containsKey(cfId)) + return null; + Set<String> repairedSSTables = sstableMap.get(cfId); Set<SSTableReader> activeSSTables = new HashSet<>(); Set<String> activeSSTableNames = new HashSet<>();