cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [10/10] git commit: fix multithreaded compaction deadlock patch by Carl Yeksigian; reviewed by jbellis for CASSANDRA-4492
Date Tue, 18 Dec 2012 20:54:37 GMT
fix multithreaded compaction deadlock
patch by Carl Yeksigian; reviewed by jbellis for CASSANDRA-4492


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

Branch: refs/heads/cassandra-1.1
Commit: 134e8c78d2acff21d960b8d78c7efd6bff5c6b29
Parents: 4885bfc
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Tue Dec 18 14:49:38 2012 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Tue Dec 18 14:51:07 2012 -0600

----------------------------------------------------------------------
 CHANGES.txt                                        |    4 ++++
 conf/cassandra.yaml                                |   15 ++++++---------
 .../db/compaction/AbstractCompactedRow.java        |    3 ++-
 .../cassandra/db/compaction/CompactionTask.java    |    3 +++
 .../db/compaction/LazilyCompactedRow.java          |    2 +-
 .../cassandra/db/compaction/PrecompactedRow.java   |    2 ++
 6 files changed, 18 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/134e8c78/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 03b62c8..cc75791 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,7 @@
+1.1.9
+ * fix multithreaded compaction deadlock (CASSANDRA-4492)
+
+
 1.1.8
  * reset getRangeSlice filter after finishing a row for get_paged_slice
    (CASSANDRA-4919)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/134e8c78/conf/cassandra.yaml
----------------------------------------------------------------------
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 543ad65..c4732db 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -381,15 +381,12 @@ in_memory_compaction_limit_in_mb: 64
 # Uncomment to make compaction mono-threaded, the pre-0.8 default.
 #concurrent_compactors: 1
 
-# multithreaded_compaction: false. When enabled, each compaction will
-# use up to one thread per core, plus one thread per sstable being
-# merged.  This is usually only useful for SSD-based hardware:
-# otherwise, your concern is usually to get compaction to do LESS i/o
-# (see: compaction_throughput_mb_per_sec), not more.
-#
-# WARNING: this setting has caused compaction deadlocks for multiple
-# users (see CASSANDRA-4492).  It is recommended to leave this off
-# unless you are prepared to help troubleshoot.
+# Multi-threaded compaction. When enabled, each compaction will use
+# up to one thread per core, plus one thread per sstable being merged.
+# This is usually only useful for SSD-based hardware: otherwise, 
+# your concern is usually to get compaction to do LESS i/o (see:
+# compaction_throughput_mb_per_sec), not more.
+multithreaded_compaction: false
 
 # Throttles compaction to the given total throughput across the entire
 # system. The faster you insert data, the faster you need to compact in

http://git-wip-us.apache.org/repos/asf/cassandra/blob/134e8c78/src/java/org/apache/cassandra/db/compaction/AbstractCompactedRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/AbstractCompactedRow.java b/src/java/org/apache/cassandra/db/compaction/AbstractCompactedRow.java
index 40c4e97..b7e4c1e 100644
--- a/src/java/org/apache/cassandra/db/compaction/AbstractCompactedRow.java
+++ b/src/java/org/apache/cassandra/db/compaction/AbstractCompactedRow.java
@@ -21,6 +21,7 @@ package org.apache.cassandra.db.compaction;
  */
 
 
+import java.io.Closeable;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.security.MessageDigest;
@@ -32,7 +33,7 @@ import org.apache.cassandra.db.DecoratedKey;
  * and can write a compacted version of those rows to an output stream.  It does
  * NOT necessarily require creating a merged CF object in memory.
  */
-public abstract class AbstractCompactedRow
+public abstract class AbstractCompactedRow implements Closeable
 {
     public final DecoratedKey<?> key;
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/134e8c78/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
index e9fcdcd..b252bc5 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
@@ -154,7 +154,10 @@ public class CompactionTask extends AbstractCompactionTask
 
                 AbstractCompactedRow row = nni.next();
                 if (row.isEmpty())
+                {
+                    row.close();
                     continue;
+                }
 
                 long position = writer.append(row);
                 totalkeysWritten++;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/134e8c78/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java b/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
index ec1dd83..d82abf8 100644
--- a/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
+++ b/src/java/org/apache/cassandra/db/compaction/LazilyCompactedRow.java
@@ -193,7 +193,7 @@ public class LazilyCompactedRow extends AbstractCompactedRow implements
IIterabl
         return maxTimestamp;
     }
 
-    private void close()
+    public void close()
     {
         for (IColumnIterator row : rows)
         {

http://git-wip-us.apache.org/repos/asf/cassandra/blob/134e8c78/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java b/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
index 8ed21ca..c66867a 100644
--- a/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
+++ b/src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
@@ -185,4 +185,6 @@ public class PrecompactedRow extends AbstractCompactedRow
     {
         return compactedCf;
     }
+
+    public void close() { }
 }


Mime
View raw message