cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [2/2] git commit: Fix assertion error in getOverlappingSSTable during repair
Date Mon, 23 Jul 2012 17:21:20 GMT
Fix assertion error in getOverlappingSSTable during repair

patch by slebresne; reviewed by jbellis for CASSANDRA-4456


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/aba1f16b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/aba1f16b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/aba1f16b

Branch: refs/heads/trunk
Commit: aba1f16be8bf45b3efefe4a42d604dea155b2595
Parents: 29379a5
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Mon Jul 23 17:25:49 2012 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Mon Jul 23 19:17:36 2012 +0200

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../cassandra/db/compaction/CompactionManager.java |   27 ++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/aba1f16b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b2a9faf..0885387 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -15,6 +15,7 @@
  * add a token generation tool (CASSANDRA-3709)
  * Fix LCS bug with sstable containing only 1 row (CASSANDRA-4411)
  * fix "Can't Modify Index Name" problem on CF update (CASSANDRA-4439)
+ * Fix assertion error in getOverlappingSSTables during repair (CASSANDRA-4456)
 Merged from 1.0:
  * allow dropping columns shadowed by not-yet-expired supercolumn or row
    tombstones in PrecompactedRow (CASSANDRA-4396)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/aba1f16b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 3c50a09..4b39280 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -55,6 +55,7 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Predicates;
 import com.google.common.collect.Iterators;
+import com.google.common.collect.ImmutableSet;
 
 /**
  * A singleton which manages a private executor of ongoing compactions. A readwrite lock
@@ -833,7 +834,31 @@ public class CompactionManager implements CompactionManagerMBean
         {
             super(OperationType.VALIDATION,
                   cfs.getCompactionStrategy().getScanners(sstables, range),
-                  new CompactionController(cfs, sstables, getDefaultGcBefore(cfs), true));
+                  new ValidationCompactionController(cfs, sstables));
+        }
+    }
+
+    /*
+     * Controller for validation compaction that never purges.
+     * Note that we should not call cfs.getOverlappingSSTables on the provided
+     * sstables because those sstables are not guaranteed to be active sstables
+     * (since we can run repair on a snapshot).
+     */
+    private static class ValidationCompactionController extends CompactionController
+    {
+        public ValidationCompactionController(ColumnFamilyStore cfs, Collection<SSTableReader>
sstables)
+        {
+            super(cfs,
+                  Integer.MAX_VALUE,
+                  true,
+                  null,
+                  cfs.getCompactionStrategy().isKeyExistenceExpensive(ImmutableSet.copyOf(sstables)));
+        }
+
+        @Override
+        public boolean shouldPurge(DecoratedKey key)
+        {
+            return false;
         }
     }
 


Mime
View raw message