You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ad...@apache.org on 2022/01/26 11:52:04 UTC

[cassandra] branch cassandra-3.0 updated: Fix conversion from megabits to bytes in streaming rate limiter

This is an automated email from the ASF dual-hosted git repository.

adelapena pushed a commit to branch cassandra-3.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.0 by this push:
     new 40bf533  Fix conversion from megabits to bytes in streaming rate limiter
40bf533 is described below

commit 40bf53359cae0805a978113a9e3156b168b48b14
Author: Andrés de la Peña <a....@gmail.com>
AuthorDate: Wed Jan 26 11:34:51 2022 +0000

    Fix conversion from megabits to bytes in streaming rate limiter
    
    patch by Andrés de la Peña; reviewed by Berenguer Blasi for CASSANDRA-17243
---
 CHANGES.txt                                                | 1 +
 NEWS.txt                                                   | 6 ++++++
 src/java/org/apache/cassandra/streaming/StreamManager.java | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 65fe841..2b9cf2a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.26:
+ * 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 0bb2547..d204aab 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -51,6 +51,12 @@ Upgrading
       confirm it is set to value lower than 31 otherwise Cassandra will fail to start. See CASSANDRA-9384
       for further details. You also need to regenerate passwords for users for who the password
       was created while the above property was set to be more than 30 otherwise they will not be able to log in.
+    - 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`.
 
 Statement re-prepare storms
 ---------------------------
diff --git a/src/java/org/apache/cassandra/streaming/StreamManager.java b/src/java/org/apache/cassandra/streaming/StreamManager.java
index 23638b9..92d155e 100644
--- a/src/java/org/apache/cassandra/streaming/StreamManager.java
+++ b/src/java/org/apache/cassandra/streaming/StreamManager.java
@@ -64,7 +64,7 @@ public class StreamManager implements StreamManagerMBean
 
     public static class StreamRateLimiter
     {
-        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 interDCLimiter = RateLimiter.create(calculateInterDCRateInBytes());
         private final boolean isLocalDC;

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org