diff --git a/CHANGES.txt b/CHANGES.txt index d9089cdebd..71a91a38b7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -111,6 +111,7 @@ Merged from 3.11: * Update Jackson from 2.9.10 to 2.12.5 (CASSANDRA-16851) * Make assassinate more resilient to missing tokens (CASSANDRA-16847) Merged from 3.0: + * Fix conversion from megabits to bytes in streaming rate limiter (CASSANDRA-17243) * Upgrade logback to 1.2.9 (CASSANDRA-17204) * Avoid race in AbstractReplicationStrategy endpoint caching (CASSANDRA-16673) * Fix abort when window resizing during cqlsh COPY (CASSANDRA-15230) diff --git a/NEWS.txt b/NEWS.txt index 560b56cc53..ff166df2c5 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -87,6 +87,12 @@ Upgrading was created while the above property was set to be more than 30 otherwise they will not be able to log in. - JNA library was updated from 5.6.0 to 5.9.0. In version 5.7.0, Darwin support for M1 devices was fixed but prebuild native library for Darwin x86 (32bit Java on Mac OS) was removed. + - The config properties for setting the streaming throughput `stream_throughput_outbound_megabits_per_sec` and + `inter_dc_stream_throughput_outbound_megabits_per_sec` were incorrectly interpreted as mebibits. This has + been fixed by CASSANDRA-17243, so the values for these properties will now indicate a throughput ~4.6% lower than + what was actually applied in previous versions. This also affects the setters and getters for these properties in + the JMX MBean `org.apache.cassandra.db:type=StorageService` and the nodetool commands `set/getstreamthroughput` + and `set/getinterdcstreamthroughput`. Deprecation ----------- diff --git a/src/java/org/apache/cassandra/streaming/StreamManager.java b/src/java/org/apache/cassandra/streaming/StreamManager.java index 8cc9494cb6..59f882124c 100644 --- a/src/java/org/apache/cassandra/streaming/StreamManager.java +++ b/src/java/org/apache/cassandra/streaming/StreamManager.java @@ -85,7 +85,7 @@ public class StreamManager implements StreamManagerMBean public static class StreamRateLimiter implements StreamingDataOutputPlus.RateLimiter { - public static final double BYTES_PER_MEGABIT = (1024 * 1024) / 8; // from bits + public static final double BYTES_PER_MEGABIT = (1000 * 1000) / 8.0; private static final RateLimiter LIMITER = RateLimiter.create(calculateRateInBytes()); private static final RateLimiter INTER_DC_LIMITER = RateLimiter.create(calculateInterDCRateInBytes()); private static final RateLimiter ENTIRE_SSTABLE_LIMITER = RateLimiter.create(calculateEntireSSTableRateInBytes());