Fix range merging when DES scores are zero

patch by thobbs; reviewed by jbellis for CASSANDRA-7535
This commit is contained in:
Jonathan Ellis 2014-07-11 23:49:36 -05:00
parent 58931dd6fe
commit a4544615df
2 changed files with 7 additions and 1 deletions

View File

@ -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)

View File

@ -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.