You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by bd...@apache.org on 2026/02/17 18:23:51 UTC
(cassandra) 03/04: ninja: fix transient keyspace setup in CMSTestBase tests
This is an automated email from the ASF dual-hosted git repository.
bdeggleston pushed a commit to branch cep-45-mutation-tracking
in repository https://gitbox.apache.org/repos/asf/cassandra.git
commit f4d9b30a4ee458cbb2c747c421a66e3ff5b1d674
Author: Blake Eggleston <bl...@ultrablake.com>
AuthorDate: Tue Feb 10 21:53:50 2026 -0800
ninja: fix transient keyspace setup in CMSTestBase tests
---
.../test/cql3/MultiNodeTableWalkWithWitnessesTest.java | 10 ++++++++++
.../org/apache/cassandra/harry/model/TokenPlacementModel.java | 9 +++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/test/distributed/org/apache/cassandra/distributed/test/cql3/MultiNodeTableWalkWithWitnessesTest.java b/test/distributed/org/apache/cassandra/distributed/test/cql3/MultiNodeTableWalkWithWitnessesTest.java
index f0446cb537..84d0ea5d84 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/cql3/MultiNodeTableWalkWithWitnessesTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/cql3/MultiNodeTableWalkWithWitnessesTest.java
@@ -18,7 +18,10 @@
package org.apache.cassandra.distributed.test.cql3;
+import java.util.List;
+
import accord.utils.RandomSource;
+import org.apache.cassandra.cql3.ast.CreateIndexDDL;
import org.apache.cassandra.distributed.Cluster;
import org.apache.cassandra.distributed.api.IInstanceConfig;
import org.apache.cassandra.schema.TableMetadata;
@@ -34,6 +37,13 @@ public class MultiNodeTableWalkWithWitnessesTest extends MultiNodeTableWalkWithM
c.set("transient_replication_enabled", "true");
}
+ @Override
+ protected List<CreateIndexDDL.Indexer> supportedIndexers()
+ {
+ // TODO (expected): Implement supported indexers for witnesses
+ return List.of();
+ }
+
protected class MultiNodeState extends State
{
public MultiNodeState(RandomSource rs, Cluster cluster)
diff --git a/test/harry/main/org/apache/cassandra/harry/model/TokenPlacementModel.java b/test/harry/main/org/apache/cassandra/harry/model/TokenPlacementModel.java
index c9dcbcb137..a92101de26 100644
--- a/test/harry/main/org/apache/cassandra/harry/model/TokenPlacementModel.java
+++ b/test/harry/main/org/apache/cassandra/harry/model/TokenPlacementModel.java
@@ -31,6 +31,7 @@ import org.apache.cassandra.locator.InetAddressAndPort;
import org.apache.cassandra.locator.SimpleStrategy;
import org.apache.cassandra.schema.KeyspaceParams;
import org.apache.cassandra.schema.ReplicationParams;
+import org.apache.cassandra.schema.ReplicationType;
import org.apache.cassandra.tcm.ClusterMetadata;
import org.apache.cassandra.tcm.membership.Location;
import org.apache.cassandra.tcm.membership.NodeId;
@@ -387,14 +388,17 @@ public class TokenPlacementModel
{
Object[] args = new Object[replication.size() * 2];
int i = 0;
+ boolean hasTransient = false;
for (Map.Entry<String, DCReplicas> e : replication.entrySet())
{
args[i * 2] = e.getKey();
args[i * 2 + 1] = e.getValue().toString();
+ if (e.getValue().transientCount > 0)
+ hasTransient = true;
i++;
}
- return KeyspaceParams.nts(args);
+ return hasTransient ? KeyspaceParams.ntsTracked(args) : KeyspaceParams.nts(args);
}
private static Function<Lookup, Map<String, DCReplicas>> mapFunction(int dcs, int nodesPerDc, int transientsPerDc)
@@ -603,7 +607,8 @@ public class TokenPlacementModel
Map<String, String> options = new HashMap<>();
options.put(ReplicationParams.CLASS, SimpleStrategy.class.getName());
options.put(SimpleStrategy.REPLICATION_FACTOR, dcReplicas().toString());
- return KeyspaceParams.create(true, options);
+ ReplicationType replicationType = dcReplicas().transientCount > 0 ? ReplicationType.tracked : ReplicationType.untracked;
+ return KeyspaceParams.create(true, options, replicationType);
}
public ReplicatedRanges replicate(Range[] ranges, List<Node> nodes)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org