diff --git a/CHANGES.txt b/CHANGES.txt index 2f2505b5cb..edf091da22 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -57,6 +57,7 @@ * Support native link w/o JNA in Java7 (CASSANDRA-3734) 1.2.6 + * Scale hinted_handoff_throttle_in_kb to cluster size (CASSANDRA-5272) * (Hadoop) Fix InputKeyRange in CFIF (CASSANDRA-5536) * Fix dealing with ridiculously large max sstable sizes in LCS (CASSANDRA-5589) * Ignore pre-truncate hints (CASSANDRA-4655) diff --git a/NEWS.txt b/NEWS.txt index 8dc28fdea7..ad8dd096de 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -66,6 +66,16 @@ Features API." +1.2.6 +===== + +Upgrading +--------- + - hinted_handoff_throttle_in_kb is now reduced by a factor + proportional to the number of nodes in the cluster (see + https://issues.apache.org/jira/browse/CASSANDRA-5272). + + 1.2.5 ===== diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml index f8cf4f7f37..93bba5fe1e 100644 --- a/conf/cassandra.yaml +++ b/conf/cassandra.yaml @@ -42,7 +42,11 @@ hinted_handoff_enabled: true # generated. After it has been dead this long, new hints for it will not be # created until it has been seen alive and gone down again. max_hint_window_in_ms: 10800000 # 3 hours -# throttle in KBs per second, per delivery thread +# Maximum throttle in KBs per second, per delivery thread. This will be +# reduced proportionally to the number of nodes in the cluster. (If there +# are two nodes in the cluster, each delivery thread will use the maximum +# rate; if there are three, each will throttle to half of the maximum, +# since we expect two nodes to be delivering hints simultaneously.) hinted_handoff_throttle_in_kb: 1024 # Number of threads with which to deliver hints; # Consider increasing this number when you have multi-dc deployments, since diff --git a/src/java/org/apache/cassandra/db/HintedHandOffManager.java b/src/java/org/apache/cassandra/db/HintedHandOffManager.java index 35727c862d..c10bed69be 100644 --- a/src/java/org/apache/cassandra/db/HintedHandOffManager.java +++ b/src/java/org/apache/cassandra/db/HintedHandOffManager.java @@ -318,7 +318,9 @@ public class HintedHandOffManager implements HintedHandOffManagerMBean logger.debug("Using pageSize of {}", pageSize); // rate limit is in bytes per second. Uses Double.MAX_VALUE if disabled (set to 0 in cassandra.yaml). - int throttleInKB = DatabaseDescriptor.getHintedHandoffThrottleInKB(); + // max rate is scaled by the number of nodes in the cluster (CASSANDRA-5272). + int throttleInKB = DatabaseDescriptor.getHintedHandoffThrottleInKB() + / (StorageService.instance.getTokenMetadata().getAllEndpoints().size() - 1); RateLimiter rateLimiter = RateLimiter.create(throttleInKB == 0 ? Double.MAX_VALUE : throttleInKB * 1024); delivery: