You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2013/12/14 00:13:43 UTC

[1/3] git commit: Fix assertion failure in filterColdSSTables patch by Tyler Hobbs; reviewed by jbellis for CASSANDRA-6483

Updated Branches:
  refs/heads/cassandra-2.0 54c1ed360 -> c96097595
  refs/heads/trunk 74bf5aa16 -> fe58dffef


Fix assertion failure in filterColdSSTables
patch by Tyler Hobbs; reviewed by jbellis for CASSANDRA-6483


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

Branch: refs/heads/cassandra-2.0
Commit: c960975950560218cb5699e4961192081d119e45
Parents: 54c1ed3
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Dec 13 17:12:47 2013 -0600
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Dec 13 17:12:47 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../SizeTieredCompactionStrategy.java           | 21 ++++++++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c9609759/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a4b34ca..182bada 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.4
+ * Fix assertion failure in filterColdSSTables (CASSANDRA-6483)
  * Fix row tombstones in larger-than-memory compactions (CASSANDRA-6008)
  * Fix cleanup ClassCastException (CASSANDRA-6462)
  * Reduce gossip memory use by interning VersionedValue strings (CASSANDRA-6410)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c9609759/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
index 09d4e8e..7ccc99d 100644
--- a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
@@ -90,12 +90,16 @@ public class SizeTieredCompactionStrategy extends AbstractCompactionStrategy
     @VisibleForTesting
     static List<SSTableReader> filterColdSSTables(List<SSTableReader> sstables, double coldReadsToOmit)
     {
-        // sort the sstables by hotness (coldest-first)
+        if (coldReadsToOmit == 0.0)
+            return sstables;
+
+        // Sort the sstables by hotness (coldest-first). We first build a map because the hotness may change during the sort.
+        final Map<SSTableReader, Double> hotnessSnapshot = getHotnessMap(sstables);
         Collections.sort(sstables, new Comparator<SSTableReader>()
         {
             public int compare(SSTableReader o1, SSTableReader o2)
             {
-                int comparison = Double.compare(hotness(o1), hotness(o2));
+                int comparison = Double.compare(hotnessSnapshot.get(o1), hotnessSnapshot.get(o2));
                 if (comparison != 0)
                     return comparison;
 
@@ -190,12 +194,13 @@ public class SizeTieredCompactionStrategy extends AbstractCompactionStrategy
     @VisibleForTesting
     static Pair<List<SSTableReader>, Double> trimToThresholdWithHotness(List<SSTableReader> bucket, int maxThreshold)
     {
-        // sort by sstable hotness (descending)
+        // Sort by sstable hotness (descending). We first build a map because the hotness may change during the sort.
+        final Map<SSTableReader, Double> hotnessSnapshot = getHotnessMap(bucket);
         Collections.sort(bucket, new Comparator<SSTableReader>()
         {
             public int compare(SSTableReader o1, SSTableReader o2)
             {
-                return -1 * Double.compare(hotness(o1), hotness(o2));
+                return -1 * Double.compare(hotnessSnapshot.get(o1), hotnessSnapshot.get(o2));
             }
         });
 
@@ -210,6 +215,14 @@ public class SizeTieredCompactionStrategy extends AbstractCompactionStrategy
         return Pair.create(prunedBucket, bucketHotness);
     }
 
+    private static Map<SSTableReader, Double> getHotnessMap(Collection<SSTableReader> sstables)
+    {
+        Map<SSTableReader, Double> hotness = new HashMap<>();
+        for (SSTableReader sstable : sstables)
+            hotness.put(sstable, hotness(sstable));
+        return hotness;
+    }
+
     /**
      * Returns the reads per second per key for this sstable, or 0.0 if the sstable has no read meter
      */


[2/3] git commit: Fix assertion failure in filterColdSSTables patch by Tyler Hobbs; reviewed by jbellis for CASSANDRA-6483

Posted by jb...@apache.org.
Fix assertion failure in filterColdSSTables
patch by Tyler Hobbs; reviewed by jbellis for CASSANDRA-6483


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

Branch: refs/heads/trunk
Commit: c960975950560218cb5699e4961192081d119e45
Parents: 54c1ed3
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Dec 13 17:12:47 2013 -0600
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Dec 13 17:12:47 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../SizeTieredCompactionStrategy.java           | 21 ++++++++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c9609759/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a4b34ca..182bada 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.4
+ * Fix assertion failure in filterColdSSTables (CASSANDRA-6483)
  * Fix row tombstones in larger-than-memory compactions (CASSANDRA-6008)
  * Fix cleanup ClassCastException (CASSANDRA-6462)
  * Reduce gossip memory use by interning VersionedValue strings (CASSANDRA-6410)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c9609759/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
index 09d4e8e..7ccc99d 100644
--- a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
@@ -90,12 +90,16 @@ public class SizeTieredCompactionStrategy extends AbstractCompactionStrategy
     @VisibleForTesting
     static List<SSTableReader> filterColdSSTables(List<SSTableReader> sstables, double coldReadsToOmit)
     {
-        // sort the sstables by hotness (coldest-first)
+        if (coldReadsToOmit == 0.0)
+            return sstables;
+
+        // Sort the sstables by hotness (coldest-first). We first build a map because the hotness may change during the sort.
+        final Map<SSTableReader, Double> hotnessSnapshot = getHotnessMap(sstables);
         Collections.sort(sstables, new Comparator<SSTableReader>()
         {
             public int compare(SSTableReader o1, SSTableReader o2)
             {
-                int comparison = Double.compare(hotness(o1), hotness(o2));
+                int comparison = Double.compare(hotnessSnapshot.get(o1), hotnessSnapshot.get(o2));
                 if (comparison != 0)
                     return comparison;
 
@@ -190,12 +194,13 @@ public class SizeTieredCompactionStrategy extends AbstractCompactionStrategy
     @VisibleForTesting
     static Pair<List<SSTableReader>, Double> trimToThresholdWithHotness(List<SSTableReader> bucket, int maxThreshold)
     {
-        // sort by sstable hotness (descending)
+        // Sort by sstable hotness (descending). We first build a map because the hotness may change during the sort.
+        final Map<SSTableReader, Double> hotnessSnapshot = getHotnessMap(bucket);
         Collections.sort(bucket, new Comparator<SSTableReader>()
         {
             public int compare(SSTableReader o1, SSTableReader o2)
             {
-                return -1 * Double.compare(hotness(o1), hotness(o2));
+                return -1 * Double.compare(hotnessSnapshot.get(o1), hotnessSnapshot.get(o2));
             }
         });
 
@@ -210,6 +215,14 @@ public class SizeTieredCompactionStrategy extends AbstractCompactionStrategy
         return Pair.create(prunedBucket, bucketHotness);
     }
 
+    private static Map<SSTableReader, Double> getHotnessMap(Collection<SSTableReader> sstables)
+    {
+        Map<SSTableReader, Double> hotness = new HashMap<>();
+        for (SSTableReader sstable : sstables)
+            hotness.put(sstable, hotness(sstable));
+        return hotness;
+    }
+
     /**
      * Returns the reads per second per key for this sstable, or 0.0 if the sstable has no read meter
      */


[3/3] git commit: merge from 2.0

Posted by jb...@apache.org.
merge from 2.0


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

Branch: refs/heads/trunk
Commit: fe58dffef5d4f44255ff47623b7d4d50a2f4e56d
Parents: 74bf5aa c960975
Author: Jonathan Ellis <jb...@apache.org>
Authored: Fri Dec 13 17:13:33 2013 -0600
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Fri Dec 13 17:13:33 2013 -0600

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 ++
 .../SizeTieredCompactionStrategy.java           | 21 ++++++++++++++++----
 2 files changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/fe58dffe/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 4c74ea9,182bada..b673918
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,24 -1,6 +1,26 @@@
 +2.1
 + * Multithreaded commitlog (CASSANDRA-3578)
 + * allocate fixed index summary memory pool and resample cold index summaries 
 +   to use less memory (CASSANDRA-5519)
 + * Removed multithreaded compaction (CASSANDRA-6142)
 + * Parallelize fetching rows for low-cardinality indexes (CASSANDRA-1337)
 + * change logging from log4j to logback (CASSANDRA-5883)
 + * switch to LZ4 compression for internode communication (CASSANDRA-5887)
 + * Stop using Thrift-generated Index* classes internally (CASSANDRA-5971)
 + * Remove 1.2 network compatibility code (CASSANDRA-5960)
 + * Remove leveled json manifest migration code (CASSANDRA-5996)
 + * Remove CFDefinition (CASSANDRA-6253)
 + * Use AtomicIntegerFieldUpdater in RefCountedMemory (CASSANDRA-6278)
 + * User-defined types for CQL3 (CASSANDRA-5590)
 + * Use of o.a.c.metrics in nodetool (CASSANDRA-5871, 6406)
 + * Batch read from OTC's queue and cleanup (CASSANDRA-1632)
 + * Secondary index support for collections (CASSANDRA-4511)
 + * SSTable metadata(Stats.db) format change (CASSANDRA-6356)
 +
 +
  2.0.4
+  * Fix assertion failure in filterColdSSTables (CASSANDRA-6483)
+  * Fix row tombstones in larger-than-memory compactions (CASSANDRA-6008)
   * Fix cleanup ClassCastException (CASSANDRA-6462)
   * Reduce gossip memory use by interning VersionedValue strings (CASSANDRA-6410)
   * Allow specifying datacenters to participate in a repair (CASSANDRA-6218)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/fe58dffe/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
----------------------------------------------------------------------