diff --git a/CHANGES.txt b/CHANGES.txt index 4fedf091a2..c140f62b7c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -19,6 +19,7 @@ Merged from 3.11: * Fix NPE when using udfContext in UDF after a restart of a node (CASSANDRA-18739) * Moved jflex from runtime to build dependencies (CASSANDRA-18664) Merged from 3.0: + * Do not set RPC_READY to false on transports shutdown in order to not fail counter updates for deployments with coordinator and storage nodes with transports turned off (CASSANDRA-18935) * Suppress CVE-2023-44487 (CASSANDRA-18943) * Fix nodetool enable/disablebinary to correctly set rpc readiness in gossip (CASSANDRA-18935) * Implement the logic in bin/stop-server (CASSANDRA-18838) diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java b/src/java/org/apache/cassandra/service/CassandraDaemon.java index 6f12abf835..201701634d 100644 --- a/src/java/org/apache/cassandra/service/CassandraDaemon.java +++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java @@ -860,7 +860,6 @@ public class CassandraDaemon { if (nativeTransportService != null) { - StorageService.instance.setRpcReady(false); nativeTransportService.stop(); } } diff --git a/test/distributed/org/apache/cassandra/distributed/test/NativeProtocolTest.java b/test/distributed/org/apache/cassandra/distributed/test/NativeProtocolTest.java index f00835e40b..16c53c9648 100644 --- a/test/distributed/org/apache/cassandra/distributed/test/NativeProtocolTest.java +++ b/test/distributed/org/apache/cassandra/distributed/test/NativeProtocolTest.java @@ -147,9 +147,10 @@ public class NativeProtocolTest extends TestBaseImpl i.runOnInstance((IIsolatedExecutor.SerializableRunnable) () -> StorageService.instance.startNativeTransport()); assertTrue(i.callOnInstance((IIsolatedExecutor.SerializableCallable) () -> StorageService.instance.isRpcReady(FBUtilities.getBroadcastAddressAndPort()))); - // by calling e.g. nodetool disablebinary, rpc will be set to false again + // by calling e.g. nodetool disablebinary, rpc will NOT be set to false again + // please read CASSANDRA-18935 for in-depth explanation why it is so i.runOnInstance((IIsolatedExecutor.SerializableRunnable) () -> StorageService.instance.stopNativeTransport()); - assertFalse(i.callOnInstance((IIsolatedExecutor.SerializableCallable) () -> StorageService.instance.isRpcReady(FBUtilities.getBroadcastAddressAndPort()))); + assertTrue(i.callOnInstance((IIsolatedExecutor.SerializableCallable) () -> StorageService.instance.isRpcReady(FBUtilities.getBroadcastAddressAndPort()))); } } } \ No newline at end of file