diff --git a/CHANGES.txt b/CHANGES.txt index 5885a9ab20..edf5aa3373 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.1.15 + * Add option to disable use of severity in DynamicEndpointSnitch (CASSANDRA-11737) * cqlsh COPY FROM fails for null values with non-prepared statements (CASSANDRA-11631) * Make cython optional in pylib/setup.py (CASSANDRA-11630) * Change order of directory searching for cassandra.in.sh to favor local one (CASSANDRA-11628) diff --git a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java index 6b6286f6c6..c84ca277c8 100644 --- a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java +++ b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java @@ -40,6 +40,8 @@ import com.yammer.metrics.stats.ExponentiallyDecayingSample; */ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements ILatencySubscriber, DynamicEndpointSnitchMBean { + private static final boolean USE_SEVERITY = !Boolean.getBoolean("cassandra.ignore_dynamic_snitch_severity"); + private static final double ALPHA = 0.75; // set to 0.75 to make EDS more biased to towards the newer values private static final int WINDOW_SIZE = 100; @@ -279,7 +281,8 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements ILa double score = entry.getValue().getSnapshot().getMedian() / maxLatency; // finally, add the severity without any weighting, since hosts scale this relative to their own load and the size of the task causing the severity. // "Severity" is basically a measure of compaction activity (CASSANDRA-3722). - score += StorageService.instance.getSeverity(entry.getKey()); + if (USE_SEVERITY) + score += StorageService.instance.getSeverity(entry.getKey()); // lowest score (least amount of badness) wins. newScores.put(entry.getKey(), score); }