From 43746c13c2d07e75adfb9f3c28d7b446d1184b1e Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Fri, 25 Apr 2025 14:27:11 -0500 Subject: [PATCH 1/2] Use MAX_PARALLEL_TRANSFERS instead of default Patch by brandonwilliams, reviewed by mck for CASSANDRA-20532 --- CHANGES.txt | 1 + .../cassandra/streaming/async/NettyStreamingMessageSender.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index ddd87100ad..70761240f1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0.18 + * Honor MAX_PARALLEL_TRANSFERS correctly (CASSANDRA-20532) * Updating a column with a new TTL but same expiration time is non-deterministic and causes repair mismatches. (CASSANDRA-20561) * Grant permission on keyspaces system_views and system_virtual_schema not possible (CASSANDRA-20171) * Avoid computing prepared statement size for unprepared batches (CASSANDRA-20556) diff --git a/src/java/org/apache/cassandra/streaming/async/NettyStreamingMessageSender.java b/src/java/org/apache/cassandra/streaming/async/NettyStreamingMessageSender.java index 4334382be4..46480cd7c4 100644 --- a/src/java/org/apache/cassandra/streaming/async/NettyStreamingMessageSender.java +++ b/src/java/org/apache/cassandra/streaming/async/NettyStreamingMessageSender.java @@ -89,7 +89,7 @@ public class NettyStreamingMessageSender implements StreamingMessageSender private static final long DEFAULT_CLOSE_WAIT_IN_MILLIS = TimeUnit.MINUTES.toMillis(5); // a simple mechansim for allowing a degree of fairnes across multiple sessions - private static final Semaphore fileTransferSemaphore = new Semaphore(DEFAULT_MAX_PARALLEL_TRANSFERS, true); + private static final Semaphore fileTransferSemaphore = new Semaphore(MAX_PARALLEL_TRANSFERS, true); private final StreamSession session; private final boolean isPreview; From b4484968bd28095950619ff22083cbeedf62002a Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Fri, 25 Apr 2025 14:30:06 -0500 Subject: [PATCH 2/2] Use MAX_PARALLEL_TRANSFERS instead of default Patch by brandonwilliams, reviewed by mck for CASSANDRA-20532 --- CHANGES.txt | 1 + .../cassandra/streaming/async/StreamingMultiplexedChannel.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index afb99c4d0b..032a805144 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ * Fix SimpleClient ability to release acquired capacity (CASSANDRA-20202) * Fix WaitQueue.Signal.awaitUninterruptibly may block forever if invoking thread is interrupted (CASSANDRA-20084) Merged from 4.0: + * Honor MAX_PARALLEL_TRANSFERS correctly (CASSANDRA-20532) * Updating a column with a new TTL but same expiration time is non-deterministic and causes repair mismatches. (CASSANDRA-20561) * Avoid computing prepared statement size for unprepared batches (CASSANDRA-20556) * Fix Dropwizard Meter causes timeouts when infrequently used (CASSANDRA-19332) diff --git a/src/java/org/apache/cassandra/streaming/async/StreamingMultiplexedChannel.java b/src/java/org/apache/cassandra/streaming/async/StreamingMultiplexedChannel.java index 99e613ee2d..548d95772d 100644 --- a/src/java/org/apache/cassandra/streaming/async/StreamingMultiplexedChannel.java +++ b/src/java/org/apache/cassandra/streaming/async/StreamingMultiplexedChannel.java @@ -95,7 +95,7 @@ public class StreamingMultiplexedChannel private static final int MAX_PARALLEL_TRANSFERS = parseInt(getProperty(PROPERTY_PREFIX + "streaming.session.parallelTransfers", Integer.toString(DEFAULT_MAX_PARALLEL_TRANSFERS))); // a simple mechansim for allowing a degree of fairness across multiple sessions - private static final Semaphore fileTransferSemaphore = newFairSemaphore(DEFAULT_MAX_PARALLEL_TRANSFERS); + private static final Semaphore fileTransferSemaphore = newFairSemaphore(MAX_PARALLEL_TRANSFERS); private final StreamingChannel.Factory factory; private final InetAddressAndPort to;