cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdeggles...@apache.org
Subject cassandra git commit: Add configurable upper bound for validation executor threads
Date Thu, 18 May 2017 23:16:44 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk d2cb90fc5 -> 8028d4bdd


Add configurable upper bound for validation executor threads

Patch by Blake Eggleston; Reviewed by Jeff Jirsa for CASSANDRA-13521


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

Branch: refs/heads/trunk
Commit: 8028d4bdd646058f18f45cad10b5de74efc415e6
Parents: d2cb90f
Author: Blake Eggleston <bdeggleston@gmail.com>
Authored: Wed May 10 13:10:14 2017 -0700
Committer: Blake Eggleston <bdeggleston@gmail.com>
Committed: Thu May 18 16:15:33 2017 -0700

----------------------------------------------------------------------
 CHANGES.txt                                           |  1 +
 conf/cassandra.yaml                                   |  4 ++++
 src/java/org/apache/cassandra/config/Config.java      |  2 ++
 .../apache/cassandra/config/DatabaseDescriptor.java   | 14 ++++++++++++++
 .../cassandra/db/compaction/CompactionManager.java    |  8 +++++++-
 .../org/apache/cassandra/service/StorageService.java  | 11 +++++++++++
 .../apache/cassandra/service/StorageServiceMBean.java |  3 +++
 7 files changed, 42 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/8028d4bd/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 9d1323d..a5afb86 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0
+ * Add configurable upper bound for validation executor threads (CASSANDRA-13521)
  * Bring back maxHintTTL propery (CASSANDRA-12982)
  * Add testing guidelines (CASSANDRA-13497)
  * Add more repair metrics (CASSANDRA-13531)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8028d4bd/conf/cassandra.yaml
----------------------------------------------------------------------
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index e968b0c..bdc68d1 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -748,6 +748,10 @@ column_index_cache_size_in_kb: 2
 # to the number of cores.
 #concurrent_compactors: 1
 
+# Number of simultaneous repair validations to allow. Default is unbounded
+# Values less than one are interpreted as unbounded (the default)
+# concurrent_validations: 0
+
 # Throttles compaction to the given total throughput across the entire
 # system. The faster you insert data, the faster you need to compact in
 # order to keep the sstable count down, but in general, setting this to

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8028d4bd/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 e76284d..b7bacde 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -171,6 +171,8 @@ public class Config
     public volatile int compaction_large_partition_warning_threshold_mb = 100;
     public int min_free_space_per_drive_in_mb = 50;
 
+    public volatile int concurrent_validations = Integer.MAX_VALUE;
+
     /**
      * @deprecated retry support removed on CASSANDRA-10992
      */

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8028d4bd/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 85f070f..2d4f191 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -562,6 +562,9 @@ public class DatabaseDescriptor
         if (conf.concurrent_compactors == null)
             conf.concurrent_compactors = Math.min(8, Math.max(2, Math.min(FBUtilities.getAvailableProcessors(),
conf.data_file_directories.length)));
 
+        if (conf.concurrent_validations < 1)
+            conf.concurrent_validations = Integer.MAX_VALUE;
+
         if (conf.concurrent_compactors <= 0)
             throw new ConfigurationException("concurrent_compactors should be strictly greater
than 0, but was " + conf.concurrent_compactors, false);
 
@@ -1400,6 +1403,17 @@ public class DatabaseDescriptor
 
     public static int getCompactionLargePartitionWarningThreshold() { return conf.compaction_large_partition_warning_threshold_mb
* 1024 * 1024; }
 
+    public static int getConcurrentValidations()
+    {
+        return conf.concurrent_validations;
+    }
+
+    public static void setConcurrentValidations(int value)
+    {
+        value = value > 0 ? value : Integer.MAX_VALUE;
+        conf.concurrent_validations = value;
+    }
+
     public static long getMinFreeSpacePerDriveInBytes()
     {
         return conf.min_free_space_per_drive_in_mb * 1024L * 1024L;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8028d4bd/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 8efeeb0..71417b6 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -1854,7 +1854,7 @@ public class CompactionManager implements CompactionManagerMBean
     {
         public ValidationExecutor()
         {
-            super(1, Integer.MAX_VALUE, "ValidationExecutor", new SynchronousQueue<Runnable>());
+            super(1, DatabaseDescriptor.getConcurrentValidations(), "ValidationExecutor",
new SynchronousQueue<Runnable>());
         }
     }
 
@@ -1975,6 +1975,12 @@ public class CompactionManager implements CompactionManagerMBean
         }
     }
 
+    public void setConcurrentValidations(int value)
+    {
+        value = value > 0 ? value : Integer.MAX_VALUE;
+        validationExecutor.setMaximumPoolSize(value);
+    }
+
     public int getCoreCompactorThreads()
     {
         return executor.getCorePoolSize();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8028d4bd/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index b8bbea0..8914440 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1363,6 +1363,17 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
         CompactionManager.instance.setConcurrentCompactors(value);
     }
 
+    public int getConcurrentValidators()
+    {
+        return DatabaseDescriptor.getConcurrentValidations();
+    }
+
+    public void setConcurrentValidators(int value)
+    {
+        DatabaseDescriptor.setConcurrentValidations(value);
+        CompactionManager.instance.setConcurrentValidations(DatabaseDescriptor.getConcurrentValidations());
+    }
+
     public boolean isIncrementalBackupsEnabled()
     {
         return DatabaseDescriptor.isIncrementalBackupsEnabled();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/8028d4bd/src/java/org/apache/cassandra/service/StorageServiceMBean.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageServiceMBean.java b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
index 348610a..d94c263 100644
--- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java
+++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
@@ -508,6 +508,9 @@ public interface StorageServiceMBean extends NotificationEmitter
     public int getConcurrentCompactors();
     public void setConcurrentCompactors(int value);
 
+    public int getConcurrentValidators();
+    public void setConcurrentValidators(int value);
+
     public boolean isIncrementalBackupsEnabled();
     public void setIncrementalBackupsEnabled(boolean value);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message