diff --git a/CHANGES.txt b/CHANGES.txt index c0c02ad259..efd9ecb2ae 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +3.11.6 +Merged from 2.2 + * In-JVM DTest: Set correct internode message version for upgrade test (CASSANDRA-15371) + 3.11.5 * Fix SASI non-literal string comparisons (range operators) (CASSANDRA-15169) * Make sure user defined compaction transactions are always closed (CASSANDRA-15123) diff --git a/test/distributed/org/apache/cassandra/distributed/impl/Instance.java b/test/distributed/org/apache/cassandra/distributed/impl/Instance.java index f22586ef89..d1d630565a 100644 --- a/test/distributed/org/apache/cassandra/distributed/impl/Instance.java +++ b/test/distributed/org/apache/cassandra/distributed/impl/Instance.java @@ -299,6 +299,13 @@ public class Instance extends IsolatedExecutor implements IInvokableInstance try (DataInputBuffer input = new DataInputBuffer(imessage.bytes())) { int version = imessage.version(); + if (version > MessagingService.current_version) + { + throw new IllegalStateException(String.format("Node%d received message version %d but current version is %d", + this.config.num(), + version, + MessagingService.current_version)); + } MessagingService.validateMagic(input.readInt()); int id; @@ -491,8 +498,10 @@ public class Instance extends IsolatedExecutor implements IInvokableInstance Gossiper.instance.realMarkAlive(ep.address, Gossiper.instance.getEndpointStateForEndpoint(ep.address)); }); - int version = Math.min(MessagingService.current_version, cluster.get(ep).getMessagingVersion()); - MessagingService.instance().setVersion(ep.address, version); + int messagingVersion = cluster.get(ep).isShutdown() + ? MessagingService.current_version + : Math.min(MessagingService.current_version, cluster.get(ep).getMessagingVersion()); + MessagingService.instance().setVersion(ep.address, messagingVersion); } // check that all nodes are in token metadata