cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [1/2] cassandra git commit: Don't check if sstables are live for offline compactions
Date Mon, 16 Mar 2015 12:40:13 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk a64f4143c -> 482cbc0c8


Don't check if sstables are live for offline compactions

Patch by marcuse; reviewed by benedict for CASSANDRA-8841


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

Branch: refs/heads/trunk
Commit: 1a77a6986852f39f983b1bb95032c134ed210605
Parents: 022e3ee
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Mon Mar 16 08:24:28 2015 +0100
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Mon Mar 16 13:35:47 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                    | 1 +
 src/java/org/apache/cassandra/db/DataTracker.java              | 6 +++---
 src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java  | 2 +-
 src/java/org/apache/cassandra/tools/StandaloneSplitter.java    | 2 +-
 .../org/apache/cassandra/io/sstable/SSTableRewriterTest.java   | 2 +-
 5 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a77a698/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d41a1a4..a48787f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.4
+ * Don't check if an sstable is live for offline compactions (CASSANDRA-8841)
  * Don't set clientMode in SSTableLoader (CASSANDRA-8238)
  * Fix SSTableRewriter with disabled early open (CASSANDRA-8535)
  * Allow invalidating permissions and cache time (CASSANDRA-8722)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a77a698/src/java/org/apache/cassandra/db/DataTracker.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DataTracker.java b/src/java/org/apache/cassandra/db/DataTracker.java
index 2c2053c..757b48a 100644
--- a/src/java/org/apache/cassandra/db/DataTracker.java
+++ b/src/java/org/apache/cassandra/db/DataTracker.java
@@ -194,9 +194,9 @@ public class DataTracker
      */
     public boolean markCompacting(Collection<SSTableReader> sstables)
     {
-        return markCompacting(sstables, false);
+        return markCompacting(sstables, false, false);
     }
-    public boolean markCompacting(Collection<SSTableReader> sstables, boolean newTables)
+    public boolean markCompacting(Collection<SSTableReader> sstables, boolean newTables,
boolean offline)
     {
         assert sstables != null && !Iterables.isEmpty(sstables);
         while (true)
@@ -214,7 +214,7 @@ public class DataTracker
             };
             if (newTables)
                 assert !Iterables.any(sstables, Predicates.in(currentView.sstables));
-            else if (!Iterables.all(sstables, live))
+            else if (!offline && !Iterables.all(sstables, live))
                 return false;
 
             View newView = currentView.markCompacting(sstables);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a77a698/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java b/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
index 641dd7c..19b2b2c 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
@@ -351,7 +351,7 @@ public class SSTableRewriter
         }
         else
         {
-            dataTracker.markCompacting(Collections.singleton(replaceWith), true);
+            dataTracker.markCompacting(Collections.singleton(replaceWith), true, isOffline);
             toReplaceSet = Collections.emptySet();
         }
         dataTracker.replaceEarlyOpenedFiles(toReplaceSet, Collections.singleton(replaceWith));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a77a698/src/java/org/apache/cassandra/tools/StandaloneSplitter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/StandaloneSplitter.java b/src/java/org/apache/cassandra/tools/StandaloneSplitter.java
index 242b1c0..bc614cc 100644
--- a/src/java/org/apache/cassandra/tools/StandaloneSplitter.java
+++ b/src/java/org/apache/cassandra/tools/StandaloneSplitter.java
@@ -146,7 +146,7 @@ public class StandaloneSplitter
             if (options.snapshot)
                 System.out.println(String.format("Pre-split sstables snapshotted into snapshot
%s", snapshotName));
 
-            cfs.getDataTracker().markCompacting(sstables);
+            cfs.getDataTracker().markCompacting(sstables, false, true);
             for (SSTableReader sstable : sstables)
             {
                 try

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1a77a698/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
index 76b89e5..09937bc 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableRewriterTest.java
@@ -577,7 +577,7 @@ public class SSTableRewriterTest extends SchemaLoader
         cfs.truncateBlocking();
         cfs.disableAutoCompaction();
         SSTableReader s = writeFile(cfs, 1000);
-        cfs.getDataTracker().markCompacting(Arrays.asList(s), true);
+        cfs.getDataTracker().markCompacting(Arrays.asList(s), true, false);
         SSTableSplitter splitter = new SSTableSplitter(cfs, s, 10);
         splitter.split();
         Thread.sleep(1000);


Mime
View raw message