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 2014/07/15 22:15:24 UTC

[1/8] git commit: Add missing table name to DROP INDEX responses

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 0b7377fed -> 9a4cc22a3
  refs/heads/cassandra-2.1.0 bd0eafd58 -> 3adf59486
  refs/heads/trunk ae25812e3 -> da650f3c6


Add missing table name to DROP INDEX responses

Patch and review by Tyler Hobbs and Aleksey Yeschenko for CASSANDRA-7539


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

Branch: refs/heads/trunk
Commit: bd0eafd5853a446b0db79547231a0a9653a74293
Parents: 0401761
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Tue Jul 15 12:23:06 2014 -0500
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Tue Jul 15 12:23:06 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                              |  1 +
 .../cassandra/cql3/statements/DropIndexStatement.java    | 11 +++++++++++
 src/java/org/apache/cassandra/transport/Event.java       |  2 ++
 3 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/bd0eafd5/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 193cff8..e6ded2a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,7 @@
 2.1.0-final
  * (Windows) fix startup when WMI memory query fails (CASSANDRA-7505)
  * Anti-compaction proceeds if any part of the repair failed (CASANDRA-7521)
+ * Add missing table name to DROP INDEX responses and notifications (CASSANDRA-7539)
 Merged from 2.0:
  * (Windows) force range-based repair to non-sequential mode (CASSANDRA-7541)
  * Fix range merging when DES scores are zero (CASSANDRA-7535)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/bd0eafd5/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java b/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java
index b8a4c9a..0562cc6 100644
--- a/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java
@@ -33,6 +33,9 @@ public class DropIndexStatement extends SchemaAlteringStatement
     public final String indexName;
     public final boolean ifExists;
 
+    // initialized in announceMigration()
+    private String indexedCF;
+
     public DropIndexStatement(IndexName indexName, boolean ifExists)
     {
         super(indexName.getCfName());
@@ -67,6 +70,7 @@ public class DropIndexStatement extends SchemaAlteringStatement
             return;
 
         CFMetaData updatedCfm = updateCFMetadata(cfm);
+        indexedCF = updatedCfm.cfName;
         MigrationManager.announceColumnFamilyUpdate(updatedCfm, false, isLocalOnly);
     }
 
@@ -106,4 +110,11 @@ public class DropIndexStatement extends SchemaAlteringStatement
         }
         return null;
     }
+
+    @Override
+    public String columnFamily()
+    {
+        assert indexedCF != null;
+        return indexedCF;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/bd0eafd5/src/java/org/apache/cassandra/transport/Event.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/transport/Event.java b/src/java/org/apache/cassandra/transport/Event.java
index 3fa2733..1b7e487 100644
--- a/src/java/org/apache/cassandra/transport/Event.java
+++ b/src/java/org/apache/cassandra/transport/Event.java
@@ -218,6 +218,8 @@ public abstract class Event
             this.target = target;
             this.keyspace = keyspace;
             this.tableOrType = tableOrType;
+            if (target != Target.KEYSPACE)
+                assert this.tableOrType != null : "Table or type should be set for non-keyspace schema change events";
         }
 
         public SchemaChange(Change change, String keyspace)


[3/8] git commit: memtable_cleanup_threshold and memtable_flush_writers defaults patch by jbellis; reviewed by bes for CASSANDRA-7551

Posted by jb...@apache.org.
memtable_cleanup_threshold and memtable_flush_writers defaults
patch by jbellis; reviewed by bes for CASSANDRA-7551


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

Branch: refs/heads/cassandra-2.1
Commit: 3adf59486a4e55f409fcc62a4c942a070b98dd8f
Parents: bd0eafd
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Jul 15 15:14:50 2014 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Jul 15 15:14:56 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 ++
 conf/cassandra.yaml                             | 23 +++++++++++++++-----
 .../org/apache/cassandra/config/Config.java     |  6 ++---
 .../cassandra/config/DatabaseDescriptor.java    |  6 +++++
 4 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e6ded2a..b20c465 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.1.0-final
+ * Updated memtable_cleanup_threshold and memtable_flush_writers defaults 
+   (CASSANDRA-7551)
  * (Windows) fix startup when WMI memory query fails (CASSANDRA-7505)
  * Anti-compaction proceeds if any part of the repair failed (CASANDRA-7521)
  * Add missing table name to DROP INDEX responses and notifications (CASSANDRA-7539)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/conf/cassandra.yaml
----------------------------------------------------------------------
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index f1e5576..4ce69fe 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -282,8 +282,13 @@ concurrent_counter_writes: 32
 # memtable_total_space_in_mb: 2048
 
 # Ratio of occupied non-flushing memtable size to total permitted size
-# that will trigger a flush of the largest memtable.
-memtable_cleanup_threshold: 0.4
+# that will trigger a flush of the largest memtable.  Lager mct will
+# mean larger flushes and hence less compaction, but also less concurrent
+# flush activity which can make it difficult to keep your disks fed
+# under heavy write load.
+#
+# memtable_cleanup_threshold defaults to 1 / (memtable_flush_writers + 1)
+#memtable_cleanup_threshold: 0.11
 
 # Specify the way Cassandra allocates and manages memtable memory.
 # Options are:
@@ -304,9 +309,14 @@ memtable_allocation_type: heap_buffers
 
 # This sets the amount of memtable flush writer threads.  These will
 # be blocked by disk io, and each one will hold a memtable in memory
-# while blocked. If your flush directory is backed by SSD, you may
-# want to increase this.
-memtable_flush_writers: 2
+# while blocked. 
+#
+# memtable_flush_writers defaults to the smaller of (number of disks,
+# number of cores), with a minimum of 2 and a maximum of 8.
+# 
+# If your data directories are backed by SSD, you should increase this
+# to the number of cores.
+#memtable_flush_writers: 8
 
 # A fixed memory pool size in MB for for SSTable index summaries. If left
 # empty, this will default to 5% of the heap size. If the memory usage of
@@ -503,6 +513,9 @@ batch_size_warn_threshold_in_kb: 5
 #
 # concurrent_compactors defaults to the smaller of (number of disks,
 # number of cores), with a minimum of 2 and a maximum of 8.
+# 
+# If your data directories are backed by SSD, you should increase this
+# to the number of cores.
 #concurrent_compactors: 1
 
 # Throttles compaction to the given total throughput across the entire

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 4d4a95b..2438e09 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -90,12 +90,10 @@ public class Config
     @Deprecated
     public Integer concurrent_replicates = null;
 
-    // we don't want a lot of contention, but we also don't want to starve all other tables
-    // if a big one flushes. OS buffering should be able to minimize contention with 2 threads.
-    public int memtable_flush_writers = 2;
+    public Integer memtable_flush_writers = null;
     public Integer memtable_heap_space_in_mb;
     public Integer memtable_offheap_space_in_mb;
-    public float memtable_cleanup_threshold = 0.4f;
+    public Double memtable_cleanup_threshold = null;
 
     public Integer storage_port = 7000;
     public Integer ssl_storage_port = 7001;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 5a2f26f..6730cb5 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -483,6 +483,12 @@ public class DatabaseDescriptor
         if (conf.commitlog_directory.equals(conf.saved_caches_directory))
             throw new ConfigurationException("saved_caches_directory must not be the same as the commitlog_directory");
 
+        if (conf.memtable_flush_writers == null)
+            conf.memtable_flush_writers = Math.min(8, Math.max(2, Math.min(FBUtilities.getAvailableProcessors(), conf.data_file_directories.length)));
+
+        if (conf.memtable_cleanup_threshold == null)
+            conf.memtable_cleanup_threshold = 1.0 / (1 + conf.memtable_flush_writers);
+
         if (conf.concurrent_compactors == null)
             conf.concurrent_compactors = Math.min(8, Math.max(2, Math.min(FBUtilities.getAvailableProcessors(), conf.data_file_directories.length)));
 


[8/8] git commit: Merge branch 'cassandra-2.1' into trunk

Posted by jb...@apache.org.
Merge branch 'cassandra-2.1' into trunk


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

Branch: refs/heads/trunk
Commit: da650f3c62bad24a3761e90b939cf98fcd1e04e5
Parents: ae25812 9a4cc22
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Jul 15 15:15:16 2014 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Jul 15 15:15:16 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 ++
 conf/cassandra.yaml                             | 23 +++++++++++++++-----
 .../org/apache/cassandra/config/Config.java     |  6 ++---
 .../cassandra/config/DatabaseDescriptor.java    |  6 +++++
 4 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/da650f3c/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/da650f3c/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------


[7/8] git commit: Merge branch 'cassandra-2.1.0' into cassandra-2.1

Posted by jb...@apache.org.
Merge branch 'cassandra-2.1.0' into cassandra-2.1


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

Branch: refs/heads/cassandra-2.1
Commit: 9a4cc22a3ebf54a52bcb7e361837ed9f51fbc58b
Parents: 0b7377f 3adf594
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Jul 15 15:15:05 2014 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Jul 15 15:15:05 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 ++
 conf/cassandra.yaml                             | 23 +++++++++++++++-----
 .../org/apache/cassandra/config/Config.java     |  6 ++---
 .../cassandra/config/DatabaseDescriptor.java    |  6 +++++
 4 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9a4cc22a/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index fc6d4eb,b20c465..65763dc
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,15 -1,6 +1,17 @@@
 +2.1.1
 + * Add listen_interface and rpc_interface options (CASSANDRA-7417)
 + * Fail to start if commit log replay detects a problem (CASSANDRA-7125)
 + * Improve schema merge performance (CASSANDRA-7444)
 + * Fix NPE when unknown prepared statement ID is used (CASSANDRA-7454)
 + * Adjust MT depth based on # of partition validating (CASSANDRA-5263)
 + * Optimise NativeCell comparisons (CASSANDRA-6755)
 + * Configurable client timeout for cqlsh (CASSANDRA-7516)
 + * Include snippet of CQL query near syntax error in messages (CASSANDRA-7111)
 +
 +
  2.1.0-final
+  * Updated memtable_cleanup_threshold and memtable_flush_writers defaults 
+    (CASSANDRA-7551)
   * (Windows) fix startup when WMI memory query fails (CASSANDRA-7505)
   * Anti-compaction proceeds if any part of the repair failed (CASANDRA-7521)
   * Add missing table name to DROP INDEX responses and notifications (CASSANDRA-7539)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9a4cc22a/conf/cassandra.yaml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9a4cc22a/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9a4cc22a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------


[5/8] git commit: memtable_cleanup_threshold and memtable_flush_writers defaults patch by jbellis; reviewed by bes for CASSANDRA-7551

Posted by jb...@apache.org.
memtable_cleanup_threshold and memtable_flush_writers defaults
patch by jbellis; reviewed by bes for CASSANDRA-7551


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

Branch: refs/heads/cassandra-2.1.0
Commit: 3adf59486a4e55f409fcc62a4c942a070b98dd8f
Parents: bd0eafd
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Jul 15 15:14:50 2014 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Jul 15 15:14:56 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 ++
 conf/cassandra.yaml                             | 23 +++++++++++++++-----
 .../org/apache/cassandra/config/Config.java     |  6 ++---
 .../cassandra/config/DatabaseDescriptor.java    |  6 +++++
 4 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e6ded2a..b20c465 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.1.0-final
+ * Updated memtable_cleanup_threshold and memtable_flush_writers defaults 
+   (CASSANDRA-7551)
  * (Windows) fix startup when WMI memory query fails (CASSANDRA-7505)
  * Anti-compaction proceeds if any part of the repair failed (CASANDRA-7521)
  * Add missing table name to DROP INDEX responses and notifications (CASSANDRA-7539)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/conf/cassandra.yaml
----------------------------------------------------------------------
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index f1e5576..4ce69fe 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -282,8 +282,13 @@ concurrent_counter_writes: 32
 # memtable_total_space_in_mb: 2048
 
 # Ratio of occupied non-flushing memtable size to total permitted size
-# that will trigger a flush of the largest memtable.
-memtable_cleanup_threshold: 0.4
+# that will trigger a flush of the largest memtable.  Lager mct will
+# mean larger flushes and hence less compaction, but also less concurrent
+# flush activity which can make it difficult to keep your disks fed
+# under heavy write load.
+#
+# memtable_cleanup_threshold defaults to 1 / (memtable_flush_writers + 1)
+#memtable_cleanup_threshold: 0.11
 
 # Specify the way Cassandra allocates and manages memtable memory.
 # Options are:
@@ -304,9 +309,14 @@ memtable_allocation_type: heap_buffers
 
 # This sets the amount of memtable flush writer threads.  These will
 # be blocked by disk io, and each one will hold a memtable in memory
-# while blocked. If your flush directory is backed by SSD, you may
-# want to increase this.
-memtable_flush_writers: 2
+# while blocked. 
+#
+# memtable_flush_writers defaults to the smaller of (number of disks,
+# number of cores), with a minimum of 2 and a maximum of 8.
+# 
+# If your data directories are backed by SSD, you should increase this
+# to the number of cores.
+#memtable_flush_writers: 8
 
 # A fixed memory pool size in MB for for SSTable index summaries. If left
 # empty, this will default to 5% of the heap size. If the memory usage of
@@ -503,6 +513,9 @@ batch_size_warn_threshold_in_kb: 5
 #
 # concurrent_compactors defaults to the smaller of (number of disks,
 # number of cores), with a minimum of 2 and a maximum of 8.
+# 
+# If your data directories are backed by SSD, you should increase this
+# to the number of cores.
 #concurrent_compactors: 1
 
 # Throttles compaction to the given total throughput across the entire

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 4d4a95b..2438e09 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -90,12 +90,10 @@ public class Config
     @Deprecated
     public Integer concurrent_replicates = null;
 
-    // we don't want a lot of contention, but we also don't want to starve all other tables
-    // if a big one flushes. OS buffering should be able to minimize contention with 2 threads.
-    public int memtable_flush_writers = 2;
+    public Integer memtable_flush_writers = null;
     public Integer memtable_heap_space_in_mb;
     public Integer memtable_offheap_space_in_mb;
-    public float memtable_cleanup_threshold = 0.4f;
+    public Double memtable_cleanup_threshold = null;
 
     public Integer storage_port = 7000;
     public Integer ssl_storage_port = 7001;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 5a2f26f..6730cb5 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -483,6 +483,12 @@ public class DatabaseDescriptor
         if (conf.commitlog_directory.equals(conf.saved_caches_directory))
             throw new ConfigurationException("saved_caches_directory must not be the same as the commitlog_directory");
 
+        if (conf.memtable_flush_writers == null)
+            conf.memtable_flush_writers = Math.min(8, Math.max(2, Math.min(FBUtilities.getAvailableProcessors(), conf.data_file_directories.length)));
+
+        if (conf.memtable_cleanup_threshold == null)
+            conf.memtable_cleanup_threshold = 1.0 / (1 + conf.memtable_flush_writers);
+
         if (conf.concurrent_compactors == null)
             conf.concurrent_compactors = Math.min(8, Math.max(2, Math.min(FBUtilities.getAvailableProcessors(), conf.data_file_directories.length)));
 


[2/8] git commit: Merge branch 'cassandra-2.1.0' into cassandra-2.1

Posted by jb...@apache.org.
Merge branch 'cassandra-2.1.0' into cassandra-2.1


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

Branch: refs/heads/trunk
Commit: 0b7377fed597eb41bc23224c80747130561165cf
Parents: 8a2d8a1 bd0eafd
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Tue Jul 15 12:24:12 2014 -0500
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Tue Jul 15 12:24:12 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                              |  1 +
 .../cassandra/cql3/statements/DropIndexStatement.java    | 11 +++++++++++
 src/java/org/apache/cassandra/transport/Event.java       |  2 ++
 3 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0b7377fe/CHANGES.txt
----------------------------------------------------------------------


[6/8] git commit: Merge branch 'cassandra-2.1.0' into cassandra-2.1

Posted by jb...@apache.org.
Merge branch 'cassandra-2.1.0' into cassandra-2.1


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

Branch: refs/heads/trunk
Commit: 9a4cc22a3ebf54a52bcb7e361837ed9f51fbc58b
Parents: 0b7377f 3adf594
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Jul 15 15:15:05 2014 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Jul 15 15:15:05 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 ++
 conf/cassandra.yaml                             | 23 +++++++++++++++-----
 .../org/apache/cassandra/config/Config.java     |  6 ++---
 .../cassandra/config/DatabaseDescriptor.java    |  6 +++++
 4 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9a4cc22a/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index fc6d4eb,b20c465..65763dc
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,15 -1,6 +1,17 @@@
 +2.1.1
 + * Add listen_interface and rpc_interface options (CASSANDRA-7417)
 + * Fail to start if commit log replay detects a problem (CASSANDRA-7125)
 + * Improve schema merge performance (CASSANDRA-7444)
 + * Fix NPE when unknown prepared statement ID is used (CASSANDRA-7454)
 + * Adjust MT depth based on # of partition validating (CASSANDRA-5263)
 + * Optimise NativeCell comparisons (CASSANDRA-6755)
 + * Configurable client timeout for cqlsh (CASSANDRA-7516)
 + * Include snippet of CQL query near syntax error in messages (CASSANDRA-7111)
 +
 +
  2.1.0-final
+  * Updated memtable_cleanup_threshold and memtable_flush_writers defaults 
+    (CASSANDRA-7551)
   * (Windows) fix startup when WMI memory query fails (CASSANDRA-7505)
   * Anti-compaction proceeds if any part of the repair failed (CASANDRA-7521)
   * Add missing table name to DROP INDEX responses and notifications (CASSANDRA-7539)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9a4cc22a/conf/cassandra.yaml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9a4cc22a/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9a4cc22a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------


[4/8] git commit: memtable_cleanup_threshold and memtable_flush_writers defaults patch by jbellis; reviewed by bes for CASSANDRA-7551

Posted by jb...@apache.org.
memtable_cleanup_threshold and memtable_flush_writers defaults
patch by jbellis; reviewed by bes for CASSANDRA-7551


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

Branch: refs/heads/trunk
Commit: 3adf59486a4e55f409fcc62a4c942a070b98dd8f
Parents: bd0eafd
Author: Jonathan Ellis <jb...@apache.org>
Authored: Tue Jul 15 15:14:50 2014 -0500
Committer: Jonathan Ellis <jb...@apache.org>
Committed: Tue Jul 15 15:14:56 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 ++
 conf/cassandra.yaml                             | 23 +++++++++++++++-----
 .../org/apache/cassandra/config/Config.java     |  6 ++---
 .../cassandra/config/DatabaseDescriptor.java    |  6 +++++
 4 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e6ded2a..b20c465 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.1.0-final
+ * Updated memtable_cleanup_threshold and memtable_flush_writers defaults 
+   (CASSANDRA-7551)
  * (Windows) fix startup when WMI memory query fails (CASSANDRA-7505)
  * Anti-compaction proceeds if any part of the repair failed (CASANDRA-7521)
  * Add missing table name to DROP INDEX responses and notifications (CASSANDRA-7539)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/conf/cassandra.yaml
----------------------------------------------------------------------
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index f1e5576..4ce69fe 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -282,8 +282,13 @@ concurrent_counter_writes: 32
 # memtable_total_space_in_mb: 2048
 
 # Ratio of occupied non-flushing memtable size to total permitted size
-# that will trigger a flush of the largest memtable.
-memtable_cleanup_threshold: 0.4
+# that will trigger a flush of the largest memtable.  Lager mct will
+# mean larger flushes and hence less compaction, but also less concurrent
+# flush activity which can make it difficult to keep your disks fed
+# under heavy write load.
+#
+# memtable_cleanup_threshold defaults to 1 / (memtable_flush_writers + 1)
+#memtable_cleanup_threshold: 0.11
 
 # Specify the way Cassandra allocates and manages memtable memory.
 # Options are:
@@ -304,9 +309,14 @@ memtable_allocation_type: heap_buffers
 
 # This sets the amount of memtable flush writer threads.  These will
 # be blocked by disk io, and each one will hold a memtable in memory
-# while blocked. If your flush directory is backed by SSD, you may
-# want to increase this.
-memtable_flush_writers: 2
+# while blocked. 
+#
+# memtable_flush_writers defaults to the smaller of (number of disks,
+# number of cores), with a minimum of 2 and a maximum of 8.
+# 
+# If your data directories are backed by SSD, you should increase this
+# to the number of cores.
+#memtable_flush_writers: 8
 
 # A fixed memory pool size in MB for for SSTable index summaries. If left
 # empty, this will default to 5% of the heap size. If the memory usage of
@@ -503,6 +513,9 @@ batch_size_warn_threshold_in_kb: 5
 #
 # concurrent_compactors defaults to the smaller of (number of disks,
 # number of cores), with a minimum of 2 and a maximum of 8.
+# 
+# If your data directories are backed by SSD, you should increase this
+# to the number of cores.
 #concurrent_compactors: 1
 
 # Throttles compaction to the given total throughput across the entire

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/src/java/org/apache/cassandra/config/Config.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 4d4a95b..2438e09 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -90,12 +90,10 @@ public class Config
     @Deprecated
     public Integer concurrent_replicates = null;
 
-    // we don't want a lot of contention, but we also don't want to starve all other tables
-    // if a big one flushes. OS buffering should be able to minimize contention with 2 threads.
-    public int memtable_flush_writers = 2;
+    public Integer memtable_flush_writers = null;
     public Integer memtable_heap_space_in_mb;
     public Integer memtable_offheap_space_in_mb;
-    public float memtable_cleanup_threshold = 0.4f;
+    public Double memtable_cleanup_threshold = null;
 
     public Integer storage_port = 7000;
     public Integer ssl_storage_port = 7001;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/3adf5948/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 5a2f26f..6730cb5 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -483,6 +483,12 @@ public class DatabaseDescriptor
         if (conf.commitlog_directory.equals(conf.saved_caches_directory))
             throw new ConfigurationException("saved_caches_directory must not be the same as the commitlog_directory");
 
+        if (conf.memtable_flush_writers == null)
+            conf.memtable_flush_writers = Math.min(8, Math.max(2, Math.min(FBUtilities.getAvailableProcessors(), conf.data_file_directories.length)));
+
+        if (conf.memtable_cleanup_threshold == null)
+            conf.memtable_cleanup_threshold = 1.0 / (1 + conf.memtable_flush_writers);
+
         if (conf.concurrent_compactors == null)
             conf.concurrent_compactors = Math.min(8, Math.max(2, Math.min(FBUtilities.getAvailableProcessors(), conf.data_file_directories.length)));