cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [02/11] git commit: Fix range merging when DES scores are zero patch by thobbs; reviewed by jbellis for CASSANDRA-7535
Date Sat, 12 Jul 2014 04:51:26 GMT
Fix range merging when DES scores are zero
patch by thobbs; reviewed by jbellis for CASSANDRA-7535


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

Branch: refs/heads/cassandra-2.0
Commit: a4544615dfcbd80122e75c1ba6288a4f17bb4389
Parents: 58931dd
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Jul 11 23:49:36 2014 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Jul 11 23:49:36 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                                   | 1 +
 .../org/apache/cassandra/locator/DynamicEndpointSnitch.java   | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a4544615/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d39cf63..e1c8922 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.10
+ * Fix range merging when DES scores are zero (CASSANDRA-7535)
  * Warn when SSL certificates have expired (CASSANDRA-7528)
  * Workaround JVM NPE on JMX bind failure (CASSANDRA-7254)
  * Fix race in FileCacheService RemovalListener (CASSANDRA-7278)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a4544615/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
index c76a196..32f52ee 100644
--- a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
+++ b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
@@ -45,6 +45,11 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements
ILa
     private int UPDATE_INTERVAL_IN_MS = DatabaseDescriptor.getDynamicUpdateInterval();
     private int RESET_INTERVAL_IN_MS = DatabaseDescriptor.getDynamicResetInterval();
     private double BADNESS_THRESHOLD = DatabaseDescriptor.getDynamicBadnessThreshold();
+
+    // the score for a merged set of endpoints must be this much worse than the score for
separate endpoints to
+    // warrant not merging two ranges into a single range
+    private double RANGE_MERGING_PREFERENCE = 1.5;
+
     private String mbeanName;
     private boolean registered = false;
 
@@ -320,7 +325,7 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements
ILa
         if (maxMerged < 0 || maxL1 < 0 || maxL2 < 0)
             return true;
 
-        return maxMerged < maxL1 + maxL2;
+        return maxMerged <= (maxL1 + maxL2) * RANGE_MERGING_PREFERENCE;
     }
 
     // Return the max score for the endpoint in the provided list, or -1.0 if no node have
a score.


Mime
View raw message