cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [05/15] cassandra git commit: Don't do defragmentation if doing reads from repaired sstables.
Date Wed, 16 Mar 2016 09:52:22 GMT
Don't do defragmentation if doing reads from repaired sstables.

Patch by marcuse; reviewed by Sylvain Lebresne for CASSANDRA-10342


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

Branch: refs/heads/cassandra-3.5
Commit: 0c53c3a9e5bcb04b951ddec0f22eca894dc3013f
Parents: 561000a
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Wed Sep 16 07:52:19 2015 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Wed Mar 16 10:44:19 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                               | 1 +
 src/java/org/apache/cassandra/db/CollationController.java | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0c53c3a9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4b505f8..04c9204 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.14
+ * Don't do defragmentation if reading from repaired sstables (CASSANDRA-10342)
  * Fix streaming_socket_timeout_in_ms not enforced (CASSANDRA-11286)
  * Avoid dropping message too quickly due to missing unit conversion (CASSANDRA-11302)
  * COPY FROM on large datasets: fix progress report and debug performance (CASSANDRA-11053)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0c53c3a9/src/java/org/apache/cassandra/db/CollationController.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/CollationController.java b/src/java/org/apache/cassandra/db/CollationController.java
index 5c6a3db..8a966bc 100644
--- a/src/java/org/apache/cassandra/db/CollationController.java
+++ b/src/java/org/apache/cassandra/db/CollationController.java
@@ -108,7 +108,7 @@ public class CollationController
 
             /* add the SSTables on disk */
             Collections.sort(view.sstables, SSTableReader.maxTimestampComparator);
-
+            boolean onlyUnrepaired = true;
             // read sorted sstables
             for (SSTableReader sstable : view.sstables)
             {
@@ -122,7 +122,8 @@ public class CollationController
                 reduceNameFilter(reducedFilter, container, currentMaxTs);
                 if (((NamesQueryFilter) reducedFilter.filter).columns.isEmpty())
                     break;
-
+                if (sstable.isRepaired())
+                    onlyUnrepaired = false;
                 Tracing.trace("Merging data from sstable {}", sstable.descriptor.generation);
                 sstable.incrementReadCount();
                 OnDiskAtomIterator iter = reducedFilter.getSSTableColumnIterator(sstable);
@@ -149,6 +150,7 @@ public class CollationController
 
             // "hoist up" the requested data into a more recent sstable
             if (sstablesIterated > cfs.getMinimumCompactionThreshold()
+                && onlyUnrepaired
                 && !cfs.isAutoCompactionDisabled()
                 && cfs.getCompactionStrategy().shouldDefragment())
             {


Mime
View raw message