mirror of https://github.com/apache/cassandra
Fix range merging when DES scores are zero
patch by thobbs; reviewed by jbellis for CASSANDRA-7535
This commit is contained in:
parent
58931dd6fe
commit
a4544615df
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue