From 1df9148ed177ddefd5ffae893756944661419464 Mon Sep 17 00:00:00 2001 From: Sam Tunnicliffe Date: Wed, 6 Dec 2023 14:14:24 +0000 Subject: [PATCH] Fix FetchLogFromPeersTest with vnodes Patch by Sam Tunnicliffe; reviewed by Alex Petrov for CASSANDRA-19072 --- .../test/log/FetchLogFromPeersTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/distributed/org/apache/cassandra/distributed/test/log/FetchLogFromPeersTest.java b/test/distributed/org/apache/cassandra/distributed/test/log/FetchLogFromPeersTest.java index d0ad1f2f34..91218e4fbb 100644 --- a/test/distributed/org/apache/cassandra/distributed/test/log/FetchLogFromPeersTest.java +++ b/test/distributed/org/apache/cassandra/distributed/test/log/FetchLogFromPeersTest.java @@ -165,7 +165,11 @@ public class FetchLogFromPeersTest extends TestBaseImpl @Test public void catchupCoordinatorBehindTestPlacements() throws Exception { + // Only runs in non-vnode configuration, because whether node2 is a replica or not before/after + // depends on the number of tokens but this is set externally to the test. The actual behaviour + // under test is completely orthogonal to the actual number of tokens though. try (Cluster cluster = init(builder().withNodes(3) + .withoutVNodes() .withTokenSupplier(TokenSupplier.evenlyDistributedTokens(4)) .withNodeIdTopology(NetworkTopology.singleDcNetworkTopology(4, "dc0", "rack0")) .start())) @@ -181,7 +185,7 @@ public class FetchLogFromPeersTest extends TestBaseImpl cluster.get(1).shutdown().get(); - // node2 is behind, reading from it will cause a failure, but it will then catch up + // node2 is behind, writing to it will cause a failure, but it will then catch up try { cluster.coordinator(2).execute(withKeyspace("insert into %s.tbl (id) values (3)"), ConsistencyLevel.QUORUM); @@ -196,7 +200,11 @@ public class FetchLogFromPeersTest extends TestBaseImpl @Test public void catchupCoordinatorAheadPlacementsReadTest() throws Exception { + // Only runs in non-vnode configuration, because whether node2 is a replica or not before/after + // depends on the number of tokens but this is set externally to the test. The actual behaviour + // under test is completely orthogonal to the actual number of tokens though. try (Cluster cluster = init(builder().withNodes(4) + .withoutVNodes() .start())) { cluster.schemaChange(withKeyspace("alter keyspace %s with replication = {'class':'SimpleStrategy', 'replication_factor':3}")); @@ -221,7 +229,11 @@ public class FetchLogFromPeersTest extends TestBaseImpl @Test public void catchupCoordinatorAheadPlacementsWriteTest() throws Throwable { + // Only runs in non-vnode configuration, because whether node2 is a replica or not before/after + // depends on the number of tokens but this is set externally to the test. The actual behaviour + // under test is completely orthogonal to the actual number of tokens though. try (Cluster cluster = init(builder().withNodes(4) + .withoutVNodes() .start())) { cluster.schemaChange(withKeyspace("alter keyspace %s with replication = {'class':'SimpleStrategy', 'replication_factor':3}"));