diff --git a/CHANGES.txt b/CHANGES.txt index c0fd4c02fc..d3390f988e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,7 @@ * (Windows) fix startup when WMI memory query fails (CASSANDRA-7505) * Anti-compaction proceeds if any part of the repair failed (CASANDRA-7521) Merged from 2.0: + * Fix range merging when DES scores are zero (CASSANDRA-7535) * Warn when SSL certificates have expired (CASSANDRA-7528) * Fix error when doing reversed queries with static columns (CASSANDRA-7490) Merged from 1.2: diff --git a/examples/hadoop_cql3_word_count/bin/word_count b/examples/hadoop_cql3_word_count/bin/word_count old mode 100644 new mode 100755 diff --git a/examples/hadoop_cql3_word_count/bin/word_count_counters b/examples/hadoop_cql3_word_count/bin/word_count_counters old mode 100644 new mode 100755 diff --git a/examples/hadoop_cql3_word_count/bin/word_count_setup b/examples/hadoop_cql3_word_count/bin/word_count_setup old mode 100644 new mode 100755 diff --git a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java index c76a196da5..32f52eec58 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.