This is an automated email from the ASF dual-hosted git repository.
smiklosovic pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push:
new 98ca5f8f1a Group nodetool cms commands into single command group
98ca5f8f1a is described below
commit 98ca5f8f1aab6659fdfd084bef38495bf50d35d6
Author: nvharikrishna <[email protected]>
AuthorDate: Wed Feb 14 15:09:06 2024 +0530
Group nodetool cms commands into single command group
patch by N. V. Harikrishna; reviewed by Stefan Miklosovic and Marcus
Eriksson for CASSANDRA-19393
---
CHANGES.txt | 1 +
.../cassandra/tcm/TransactionalClusterMetadata.md | 4 +-
src/java/org/apache/cassandra/tools/NodeTool.java | 10 +-
.../apache/cassandra/tools/nodetool/CMSAdmin.java | 163 +++++++++++++++++++++
.../cassandra/tools/nodetool/DescribeCMS.java | 44 ------
.../cassandra/tools/nodetool/InitializeCMS.java | 39 -----
.../cassandra/tools/nodetool/ReconfigureCMS.java | 128 ----------------
.../cassandra/distributed/test/TestBaseImpl.java | 2 +-
.../distributed/test/log/ReconfigureCMSTest.java | 17 ++-
.../test/log/TriggeredReconfigureCMSTest.java | 6 +-
.../ClusterMetadataSingleNodeUpgradeTest.java | 2 +-
.../upgrade/ClusterMetadataUpgradeHarryTest.java | 4 +-
.../upgrade/ClusterMetadataUpgradeHostIdTest.java | 2 +-
.../ClusterMetadataUpgradeIgnoreHostTest.java | 6 +-
.../ClusterMetadataUpgradeIgnoreHostsTest.java | 6 +-
.../upgrade/ClusterMetadataUpgradeTest.java | 4 +-
.../upgrade/DropCompactStorageTest.java | 2 +-
17 files changed, 199 insertions(+), 241 deletions(-)
diff --git a/CHANGES.txt b/CHANGES.txt
index f7ac26859f..7bd2710ddf 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
5.1
+ * Group nodetool cms commands into single command group (CASSANDRA-19393)
* Register the measurements of the bootstrap process as Dropwizard metrics
(CASSANDRA-19447)
* Add LIST SUPERUSERS CQL statement (CASSANDRA-19417)
* Modernize CQLSH datetime conversions (CASSANDRA-18879)
diff --git a/src/java/org/apache/cassandra/tcm/TransactionalClusterMetadata.md
b/src/java/org/apache/cassandra/tcm/TransactionalClusterMetadata.md
index 75fada86ae..1b691bba8c 100644
--- a/src/java/org/apache/cassandra/tcm/TransactionalClusterMetadata.md
+++ b/src/java/org/apache/cassandra/tcm/TransactionalClusterMetadata.md
@@ -71,7 +71,7 @@ Nodes provide each other with missing log entries in the form
of a `LogState`, w
Following an upgrade, nodes in an existing cluster will enter a minimal
modification mode. In this state, the set of allowed cluster metadata
modifications is constrained to include only the addition, removal and
replacement of nodes, to allow failed hosts to be replaced during the
upgrade. In this mode the CMS has no members and each peer maintains its own
`ClusterMetadata` instance independently. This metadata is intitialised at
startup from system tables and gossip is used to propagate the permitted subset
of metadata changes.
-When the operator is ready, one node is chosen for promotion to the initial
CMS, which is done manually via nodetool `initializecms`. At this point, the
candidate node will propose itself as the initial CMS and attempt to gain
consensus from the rest of the cluster. If successful, it verifies that all
peers have an identical view of cluster metadata and initialises the
distributed log with a snapshot of that metadata.
+When the operator is ready, one node is chosen for promotion to the initial
CMS, which is done manually via nodetool `cms initialize`. At this point, the
candidate node will propose itself as the initial CMS and attempt to gain
consensus from the rest of the cluster. If successful, it verifies that all
peers have an identical view of cluster metadata and initialises the
distributed log with a snapshot of that metadata.
-Once this process is complete all future cluster metadata updates are
performed via the CMS using the global log and reverting to the previous method
of metadata management is not supported. Further members can and should be
added to the CMS using nodetool's `reconfigurecms` command.
+Once this process is complete all future cluster metadata updates are
performed via the CMS using the global log and reverting to the previous method
of metadata management is not supported. Further members can and should be
added to the CMS using nodetool's `cms reconfigure` command.
diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java
b/src/java/org/apache/cassandra/tools/NodeTool.java
index 8e2c6f45cd..e653e7e2b5 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -107,7 +107,6 @@ public class NodeTool
DataPaths.class,
Decommission.class,
DescribeCluster.class,
- DescribeCMS.class,
DescribeRing.class,
DisableAuditLog.class,
DisableAutoCompaction.class,
@@ -158,7 +157,6 @@ public class NodeTool
GossipInfo.class,
Import.class,
Info.class,
- InitializeCMS.class,
InvalidateCIDRPermissionsCache.class,
InvalidateCounterCache.class,
InvalidateCredentialsCache.class,
@@ -182,7 +180,6 @@ public class NodeTool
Rebuild.class,
RebuildIndex.class,
RecompressSSTables.class,
- ReconfigureCMS.class,
Refresh.class,
RefreshSizeEstimates.class,
ReloadLocalSchema.class,
@@ -262,6 +259,13 @@ public class NodeTool
.withCommand(RepairAdmin.SummarizePendingCmd.class)
.withCommand(RepairAdmin.SummarizeRepairedCmd.class);
+ builder.withGroup("cms")
+ .withDescription("Manage cluster metadata")
+ .withDefaultCommand(CMSAdmin.DescribeCMS.class)
+ .withCommand(CMSAdmin.DescribeCMS.class)
+ .withCommand(CMSAdmin.InitializeCMS.class)
+ .withCommand(CMSAdmin.ReconfigureCMS.class);
+
Cli<NodeToolCmdRunnable> parser = builder.build();
int status = 0;
diff --git a/src/java/org/apache/cassandra/tools/nodetool/CMSAdmin.java
b/src/java/org/apache/cassandra/tools/nodetool/CMSAdmin.java
new file mode 100644
index 0000000000..0e07bdfa22
--- /dev/null
+++ b/src/java/org/apache/cassandra/tools/nodetool/CMSAdmin.java
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.tools.nodetool;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import io.airlift.airline.Arguments;
+import io.airlift.airline.Command;
+import io.airlift.airline.Option;
+import org.apache.cassandra.tools.NodeProbe;
+import org.apache.cassandra.tools.NodeTool;
+
+public abstract class CMSAdmin extends NodeTool.NodeToolCmd
+{
+ @Command(name = "describe", description = "Describe the current Cluster
Metadata Service")
+ public static class DescribeCMS extends NodeTool.NodeToolCmd
+ {
+ @Override
+ protected void execute(NodeProbe probe)
+ {
+ Map<String, String> info =
probe.getCMSOperationsProxy().describeCMS();
+ output.out.printf("Cluster Metadata Service:%n");
+ output.out.printf("Members: %s%n", info.get("MEMBERS"));
+ output.out.printf("Is Member: %s%n", info.get("IS_MEMBER"));
+ output.out.printf("Service State: %s%n",
info.get("SERVICE_STATE"));
+ output.out.printf("Is Migrating: %s%n", info.get("IS_MIGRATING"));
+ output.out.printf("Epoch: %s%n", info.get("EPOCH"));
+ output.out.printf("Local Pending Count: %s%n",
info.get("LOCAL_PENDING"));
+ output.out.printf("Commits Paused: %s%n",
info.get("COMMITS_PAUSED"));
+ output.out.printf("Replication factor: %s%n",
info.get("REPLICATION_FACTOR"));
+ }
+ }
+
+ @Command(name = "initialize", description = "Upgrade from gossip and
initialize CMS")
+ public static class InitializeCMS extends NodeTool.NodeToolCmd
+ {
+ @Option(title = "ignored endpoints", name = { "-i", "--ignore"},
description = "Hosts to ignore due to them being down")
+ private List<String> endpoint = new ArrayList<>();
+
+ @Override
+ protected void execute(NodeProbe probe)
+ {
+ probe.getCMSOperationsProxy().initializeCMS(endpoint);
+ }
+ }
+
+ @Command(name = "reconfigure", description = "Reconfigure replication
factor of CMS")
+ public static class ReconfigureCMS extends NodeTool.NodeToolCmd
+ {
+ @Option(title = "status",
+ name = {"--status"},
+ description = "Poll status of the reconfigure command. All other flags
and arguments are ignored when this one is used.")
+ private boolean status = false;
+
+ @Option(title = "resume",
+ name = {"-r", "--resume"},
+ description = "Whether or not a previously interrupted sequence should
be resumed")
+ private boolean resume = false;
+
+ @Option(title = "cancel",
+ name = {"-c", "--cancel"},
+ description = "Cancels any in progress CMS reconfiguration")
+ private boolean cancel = false;
+
+ @Arguments(usage = "[<replication factor>] or
<datacenter>:<replication_factor> ... ", description = "Replication factor of
new CMS")
+ private List<String> args = new ArrayList<>();
+
+ @Override
+ protected void execute(NodeProbe probe)
+ {
+ if (status)
+ {
+ Map<String, List<String>> status =
probe.getCMSOperationsProxy().reconfigureCMSStatus();
+ if (status == null)
+ {
+ output.out.println("No active reconfiguration");
+ }
+ else
+ {
+ for (Map.Entry<String, List<String>> e : status.entrySet())
+ output.out.printf("%s: %s%n", e.getKey(),
e.getValue());
+ }
+ return;
+ }
+ if (resume)
+ {
+ if (!args.isEmpty())
+ throw new IllegalArgumentException("Replication factor
should not be set if previous operation is resumed");
+
+ probe.getCMSOperationsProxy().resumeReconfigureCms();
+ return;
+ }
+
+ if (cancel)
+ {
+ probe.getCMSOperationsProxy().cancelReconfigureCms();
+ return;
+ }
+
+ if (args.isEmpty())
+ throw new IllegalArgumentException("Replication factor is
empty");
+
+ Map<String, Integer> parsedRfs = new HashMap<>(args.size());
+ for (String rf : args)
+ {
+ if (!rf.contains(":"))
+ {
+ if (args.size() > 1)
+ throw new IllegalArgumentException("Simple placement
can only specify a single replication factor accross all data centers");
+ int parsedRf;
+ try
+ {
+ parsedRf = Integer.parseInt(args.get(0));
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalArgumentException(String.format("Can
not parse replication factor from %s", args.get(0)));
+ }
+ probe.getCMSOperationsProxy().reconfigureCMS(parsedRf);
+ return;
+ }
+ else
+ {
+ String[] splits = rf.split(":");
+ if (splits.length > 2)
+ throw new IllegalArgumentException(String.format("Can
not parse replication factor %s", rf));
+ String dc = splits[0];
+ int parsedRf;
+ try
+ {
+ parsedRf = Integer.parseInt(splits[1]);
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalArgumentException(String.format("Can
not parse replication factor from %s", args.get(0)));
+ }
+ parsedRfs.put(dc, parsedRf);
+ }
+ }
+
+ probe.getCMSOperationsProxy().reconfigureCMS(parsedRfs);
+ }
+ }
+}
diff --git a/src/java/org/apache/cassandra/tools/nodetool/DescribeCMS.java
b/src/java/org/apache/cassandra/tools/nodetool/DescribeCMS.java
deleted file mode 100644
index 813a2d01d5..0000000000
--- a/src/java/org/apache/cassandra/tools/nodetool/DescribeCMS.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.cassandra.tools.nodetool;
-
-import java.util.Map;
-
-import io.airlift.airline.Command;
-import org.apache.cassandra.tools.NodeProbe;
-import org.apache.cassandra.tools.NodeTool;
-
-@Command(name = "describecms", description = "Describe the current Cluster
Metadata Service")
-public class DescribeCMS extends NodeTool.NodeToolCmd
-{
- @Override
- protected void execute(NodeProbe probe)
- {
- Map<String, String> info = probe.getCMSOperationsProxy().describeCMS();
- System.out.printf("Cluster Metadata Service:%n");
- System.out.printf("Members: %s%n", info.get("MEMBERS"));
- System.out.printf("Is Member: %s%n", info.get("IS_MEMBER"));
- System.out.printf("Service State: %s%n", info.get("SERVICE_STATE"));
- System.out.printf("Is Migrating: %s%n", info.get("IS_MIGRATING"));
- System.out.printf("Epoch: %s%n", info.get("EPOCH"));
- System.out.printf("Local Pending Count: %s%n",
info.get("LOCAL_PENDING"));
- System.out.printf("Commits Paused: %s%n", info.get("COMMITS_PAUSED"));
- System.out.printf("Replication factor: %s%n",
info.get("REPLICATION_FACTOR"));
- }
-}
diff --git a/src/java/org/apache/cassandra/tools/nodetool/InitializeCMS.java
b/src/java/org/apache/cassandra/tools/nodetool/InitializeCMS.java
deleted file mode 100644
index 316862aeec..0000000000
--- a/src/java/org/apache/cassandra/tools/nodetool/InitializeCMS.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.cassandra.tools.nodetool;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import io.airlift.airline.Command;
-import io.airlift.airline.Option;
-import org.apache.cassandra.tools.NodeProbe;
-import org.apache.cassandra.tools.NodeTool;
-
-@Command(name = "initializecms", description = "Upgrade from gossip and
initialize CMS")
-public class InitializeCMS extends NodeTool.NodeToolCmd
-{
- @Option(title = "ignored endpoints", name = {"-i", "--ignore"},
description = "Hosts to ignore due to them being down", required = false)
- private List<String> endpoint = new ArrayList<>();
- @Override
- protected void execute(NodeProbe probe)
- {
- probe.getCMSOperationsProxy().initializeCMS(endpoint);
- }
-}
\ No newline at end of file
diff --git a/src/java/org/apache/cassandra/tools/nodetool/ReconfigureCMS.java
b/src/java/org/apache/cassandra/tools/nodetool/ReconfigureCMS.java
deleted file mode 100644
index 7133a44dc9..0000000000
--- a/src/java/org/apache/cassandra/tools/nodetool/ReconfigureCMS.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.cassandra.tools.nodetool;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import io.airlift.airline.Arguments;
-import io.airlift.airline.Command;
-import io.airlift.airline.Option;
-import org.apache.cassandra.tools.NodeProbe;
-import org.apache.cassandra.tools.NodeTool;
-
-@Command(name = "reconfigurecms", description = "Reconfigure replication
factor of CMS")
-public class ReconfigureCMS extends NodeTool.NodeToolCmd
-{
- @Option(title = "status",
- name = {"--status"},
- description = "Poll status of the reconfigurecms command. All other flags
and arguments are ignored when this one is used.")
- private boolean status = false;
-
- @Option(title = "resume",
- name = {"-r", "--resume"},
- description = "Whether or not a previously interrupted sequence should be
resumed")
- private boolean resume = false;
-
- @Option(title = "cancel",
- name = {"-c", "--cancel"},
- description = "Cancels any in progress CMS reconfiguration")
- private boolean cancel = false;
-
- @Arguments(usage = "[<replication factor>] or
<datacenter>:<replication_factor> ... ", description = "Replication factor of
new CMS")
- private List<String> args = new ArrayList<>();
-
- @Override
- protected void execute(NodeProbe probe)
- {
- if (status)
- {
- Map<String, List<String>> status =
probe.getCMSOperationsProxy().reconfigureCMSStatus();
- if (status == null)
- {
- System.out.println("No active reconfiguration");
- }
- else
- {
- for (Map.Entry<String, List<String>> e : status.entrySet())
- System.out.println(String.format("%s: %s", e.getKey(),
e.getValue()));
- }
- return;
- }
- if (resume)
- {
- if (!args.isEmpty())
- throw new IllegalArgumentException("Replication factor should
not be set if previous operation is resumed");
-
- probe.getCMSOperationsProxy().resumeReconfigureCms();
- return;
- }
-
- if (cancel)
- {
- probe.getCMSOperationsProxy().cancelReconfigureCms();
- return;
- }
-
- if (args.isEmpty())
- throw new IllegalArgumentException("Replication factor is empty");
-
- Map<String, Integer> parsedRfs = new HashMap<>(args.size());
- for (String rf : args)
- {
- if (!rf.contains(":"))
- {
- if (args.size() > 1)
- throw new IllegalArgumentException("Simple placement can
only specify a single replication factor accross all data centers");
- int parsedRf;
- try
- {
- parsedRf = Integer.parseInt(args.get(0));
- }
- catch (Throwable t)
- {
- throw new IllegalArgumentException(String.format("Can not
parse replication factor from %s", args.get(0)));
- }
- probe.getCMSOperationsProxy().reconfigureCMS(parsedRf);
- return;
- }
- else
- {
- String[] splits = rf.split(":");
- if (splits.length > 2)
- throw new IllegalArgumentException(String.format("Can not
parse replication factor %s", rf));
- String dc = splits[0];
- int parsedRf;
- try
- {
- parsedRf = Integer.parseInt(splits[1]);
- }
- catch (Throwable t)
- {
- throw new IllegalArgumentException(String.format("Can not
parse replication factor from %s", args.get(0)));
- }
- parsedRfs.put(dc, parsedRf);
- }
- }
-
- probe.getCMSOperationsProxy().reconfigureCMS(parsedRfs);
- }
-}
diff --git
a/test/distributed/org/apache/cassandra/distributed/test/TestBaseImpl.java
b/test/distributed/org/apache/cassandra/distributed/test/TestBaseImpl.java
index 72ba9d4f04..f093410a62 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/TestBaseImpl.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/TestBaseImpl.java
@@ -152,7 +152,7 @@ public class TestBaseImpl extends DistributedTestBase
withProperty(JOIN_RING, false,
() -> newInstance.startup(cluster));
newInstance.nodetoolResult("join").asserts().success();
- newInstance.nodetoolResult("describecms").asserts().success(); // just
make sure we're joined, remove later
+ newInstance.nodetoolResult("cms", "describe").asserts().success(); //
just make sure we're joined, remove later
}
@SuppressWarnings("unchecked")
diff --git
a/test/distributed/org/apache/cassandra/distributed/test/log/ReconfigureCMSTest.java
b/test/distributed/org/apache/cassandra/distributed/test/log/ReconfigureCMSTest.java
index 0c23ac429d..02a14a344e 100644
---
a/test/distributed/org/apache/cassandra/distributed/test/log/ReconfigureCMSTest.java
+++
b/test/distributed/org/apache/cassandra/distributed/test/log/ReconfigureCMSTest.java
@@ -54,9 +54,9 @@ public class ReconfigureCMSTest extends FuzzTestBase
cluster.setUncaughtExceptionsFilter(t -> t.getMessage() != null &&
t.getMessage().contains("There are not enough nodes in dc0 datacenter to
satisfy replication factor"));
Random rnd = new Random(2);
Supplier<Integer> nodeSelector = () -> rnd.nextInt(cluster.size()
- 1) + 1;
- cluster.get(nodeSelector.get()).nodetoolResult("reconfigurecms",
"0").asserts().failure();
- cluster.get(nodeSelector.get()).nodetoolResult("reconfigurecms",
"500").asserts().failure();
- cluster.get(nodeSelector.get()).nodetoolResult("reconfigurecms",
"5").asserts().success();
+ cluster.get(nodeSelector.get()).nodetoolResult("cms",
"reconfigure", "0").asserts().failure();
+ cluster.get(nodeSelector.get()).nodetoolResult("cms",
"reconfigure", "500").asserts().failure();
+ cluster.get(nodeSelector.get()).nodetoolResult("cms",
"reconfigure", "5").asserts().success();
cluster.get(1).runOnInstance(() -> {
ClusterMetadata metadata = ClusterMetadata.current();
Assert.assertEquals(5, metadata.fullCMSMembers().size());
@@ -67,7 +67,7 @@ public class ReconfigureCMSTest extends FuzzTestBase
Assert.assertTrue(i.executeInternal(String.format("SELECT *
FROM %s.%s", SchemaConstants.METADATA_KEYSPACE_NAME,
DistributedMetadataLogKeyspace.TABLE_NAME)).length > 0);
});
- cluster.get(nodeSelector.get()).nodetoolResult("reconfigurecms",
"1").asserts().success();
+ cluster.get(nodeSelector.get()).nodetoolResult("cms",
"reconfigure", "1").asserts().success();
cluster.get(1).runOnInstance(() -> {
ClusterMetadata metadata = ClusterMetadata.current();
Assert.assertEquals(1, metadata.fullCMSMembers().size());
@@ -87,7 +87,7 @@ public class ReconfigureCMSTest extends FuzzTestBase
.with(Feature.NETWORK, Feature.GOSSIP))
.start())
{
- cluster.get(1).nodetoolResult("reconfigurecms",
"2").asserts().success();
+ cluster.get(1).nodetoolResult("cms", "reconfigure",
"2").asserts().success();
cluster.get(1).runOnInstance(() -> {
ClusterMetadataService.instance().commit(new
PrepareCMSReconfiguration.Complex(ReplicationParams.simple(3).asMeta()));
ReconfigureCMS reconfigureCMS = (ReconfigureCMS)
ClusterMetadata.current().inProgressSequences.get(ReconfigureCMS.SequenceKey.instance);
@@ -105,7 +105,7 @@ public class ReconfigureCMSTest extends FuzzTestBase
reconfigureCMS = (ReconfigureCMS)
ClusterMetadata.current().inProgressSequences.get(ReconfigureCMS.SequenceKey.instance);
Assert.assertNotNull(reconfigureCMS.next.activeTransition);
});
- cluster.get(1).nodetoolResult("reconfigurecms",
"--cancel").asserts().success();
+ cluster.get(1).nodetoolResult("cms", "reconfigure",
"--cancel").asserts().success();
cluster.get(1).runOnInstance(() -> {
ProgressBarrier.propagateLast(EntireRange.affectedRanges(ClusterMetadata.current()));
ClusterMetadata metadata = ClusterMetadata.current();
@@ -130,7 +130,7 @@ public class ReconfigureCMSTest extends FuzzTestBase
reconfigureCMS = (ReconfigureCMS)
ClusterMetadata.current().inProgressSequences.get(ReconfigureCMS.SequenceKey.instance);
Assert.assertNull(reconfigureCMS.next.activeTransition);
});
- cluster.get(1).nodetoolResult("reconfigurecms",
"--cancel").asserts().success();
+ cluster.get(1).nodetoolResult("cms", "reconfigure",
"--cancel").asserts().success();
cluster.get(1).runOnInstance(() -> {
ProgressBarrier.propagateLast(EntireRange.affectedRanges(ClusterMetadata.current()));
ClusterMetadata metadata = ClusterMetadata.current();
@@ -141,4 +141,5 @@ public class ReconfigureCMSTest extends FuzzTestBase
Assert.assertEquals(placements.reads, placements.writes);
});
}
- }}
+ }
+}
diff --git
a/test/distributed/org/apache/cassandra/distributed/test/log/TriggeredReconfigureCMSTest.java
b/test/distributed/org/apache/cassandra/distributed/test/log/TriggeredReconfigureCMSTest.java
index 44b8cada6f..d800a3d6bc 100644
---
a/test/distributed/org/apache/cassandra/distributed/test/log/TriggeredReconfigureCMSTest.java
+++
b/test/distributed/org/apache/cassandra/distributed/test/log/TriggeredReconfigureCMSTest.java
@@ -60,7 +60,7 @@ public class TriggeredReconfigureCMSTest extends FuzzTestBase
.with(Feature.NETWORK, Feature.GOSSIP))
.start())
{
- cluster.get(1).nodetoolResult("reconfigurecms",
"3").asserts().success();
+ cluster.get(1).nodetoolResult("cms", "reconfigure",
"3").asserts().success();
Set<String> cms = getCMSMembers(cluster.get(1));
assertEquals(3, cms.size());
@@ -100,7 +100,7 @@ public class TriggeredReconfigureCMSTest extends
FuzzTestBase
.with(Feature.NETWORK, Feature.GOSSIP))
.start())
{
- cluster.get(1).nodetoolResult("reconfigurecms",
"3").asserts().success();
+ cluster.get(1).nodetoolResult("cms", "reconfigure",
"3").asserts().success();
Set<String> cms = getCMSMembers(cluster.get(1));
assertEquals(3, cms.size());
cluster.get(1).nodetoolResult("decommission").asserts().success();
@@ -119,7 +119,7 @@ public class TriggeredReconfigureCMSTest extends
FuzzTestBase
.with(Feature.NETWORK, Feature.GOSSIP))
.start())
{
- cluster.get(1).nodetoolResult("reconfigurecms",
"3").asserts().success();
+ cluster.get(1).nodetoolResult("cms", "reconfigure",
"3").asserts().success();
Set<String> cms = getCMSMembers(cluster.get(1));
assertEquals(3, cms.size());
assertTrue(cms.contains("/127.0.0.1"));
diff --git
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataSingleNodeUpgradeTest.java
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataSingleNodeUpgradeTest.java
index 62b77e3fdb..6750825d43 100644
---
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataSingleNodeUpgradeTest.java
+++
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataSingleNodeUpgradeTest.java
@@ -39,7 +39,7 @@ public class ClusterMetadataSingleNodeUpgradeTest extends
UpgradeTestBase
cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int,
ck int, v int, PRIMARY KEY (pk, ck))");
})
.runAfterClusterUpgrade((cluster) -> {
- cluster.get(1).nodetoolResult("initializecms").asserts().success();
+ cluster.get(1).nodetoolResult("cms",
"initialize").asserts().success();
// make sure we can execute transformations:
cluster.schemaChange(withKeyspace("ALTER TABLE %s.tbl with comment
= 'hello123'"));
}).run();
diff --git
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHarryTest.java
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHarryTest.java
index 1ed127bbb6..e165a0d16e 100644
---
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHarryTest.java
+++
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHarryTest.java
@@ -117,8 +117,8 @@ public class ClusterMetadataUpgradeHarryTest extends
UpgradeTestBase
assertEquals(0, res.length);
});
- cluster.get(1).nodetoolResult("initializecms").asserts().success();
- cluster.get(1).nodetoolResult("reconfigurecms",
"3").asserts().success();
+ cluster.get(1).nodetoolResult("cms",
"initialize").asserts().success();
+ cluster.get(1).nodetoolResult("cms", "reconfigure",
"3").asserts().success();
cluster.schemaChange(withKeyspace("create table %s.xyz (id int
primary key)"));
stopLatch.decrement();
harryRunner.get().get();
diff --git
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHostIdTest.java
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHostIdTest.java
index c05279da1f..6f6ffb756e 100644
---
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHostIdTest.java
+++
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHostIdTest.java
@@ -59,7 +59,7 @@ public class ClusterMetadataUpgradeHostIdTest extends
UpgradeTestBase
for (int i = 1; i <= 3; i++)
assertEquals(expectedUUIDs, getHostIds(cluster, i));
- cluster.get(1).nodetoolResult("initializecms").asserts().success();
+ cluster.get(1).nodetoolResult("cms",
"initialize").asserts().success();
Map<InetAddressAndPort, UUID> postUpgradeUUIDs = new
HashMap<>(getHostIds(cluster, 1));
boolean found = false;
diff --git
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeIgnoreHostTest.java
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeIgnoreHostTest.java
index 290af7acc8..51267db100 100644
---
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeIgnoreHostTest.java
+++
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeIgnoreHostTest.java
@@ -42,9 +42,9 @@ public class ClusterMetadataUpgradeIgnoreHostTest extends
UpgradeTestBase
// todo; isolate node 3 - actually shutting it down makes us throw
exceptions when test finishes
cluster.filters().allVerbs().to(3).drop();
cluster.filters().allVerbs().from(3).drop();
-
cluster.get(1).nodetoolResult("initializecms").asserts().failure(); // node3
unreachable
- cluster.get(1).nodetoolResult("initializecms", "--ignore",
"127.0.0.1").asserts().failure(); // can't ignore localhost
- cluster.get(1).nodetoolResult("initializecms", "--ignore",
"127.0.0.3").asserts().success();
+ cluster.get(1).nodetoolResult("cms",
"initialize").asserts().failure(); // node3 unreachable
+ cluster.get(1).nodetoolResult("cms", "initialize", "--ignore",
"127.0.0.1").asserts().failure(); // can't ignore localhost
+ cluster.get(1).nodetoolResult("cms", "initialize", "--ignore",
"127.0.0.3").asserts().success();
}).run();
}
}
diff --git
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeIgnoreHostsTest.java
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeIgnoreHostsTest.java
index 8dc7940441..d89b902d7c 100644
---
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeIgnoreHostsTest.java
+++
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeIgnoreHostsTest.java
@@ -42,9 +42,9 @@ public class ClusterMetadataUpgradeIgnoreHostsTest extends
UpgradeTestBase
// todo; isolate node 3 - actually shutting it down makes us throw
exceptions when test finishes
cluster.filters().allVerbs().to(3).drop();
cluster.filters().allVerbs().from(3).drop();
-
cluster.get(1).nodetoolResult("initializecms").asserts().failure(); // node3
unreachable
- cluster.get(1).nodetoolResult("initializecms", "--ignore",
"127.0.0.1").asserts().failure(); // can't ignore localhost
- cluster.get(1).nodetoolResult("initializecms", "--ignore",
"127.0.0.3").asserts().success();
+ cluster.get(1).nodetoolResult("cms",
"initialize").asserts().failure(); // node3 unreachable
+ cluster.get(1).nodetoolResult("cms", "initialize", "--ignore",
"127.0.0.1").asserts().failure(); // can't ignore localhost
+ cluster.get(1).nodetoolResult("cms", "initialize", "--ignore",
"127.0.0.3").asserts().success();
}).run();
}
}
diff --git
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeTest.java
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeTest.java
index b6b501b54c..4bc08314b7 100644
---
a/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeTest.java
+++
b/test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeTest.java
@@ -48,14 +48,14 @@ public class ClusterMetadataUpgradeTest extends
UpgradeTestBase
cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int,
ck int, v int, PRIMARY KEY (pk, ck))");
})
.runAfterClusterUpgrade((cluster) -> {
- cluster.get(1).nodetoolResult("initializecms").asserts().success();
+
cluster.get(1).nodetoolResult("cms","initialize").asserts().success();
cluster.forEach(i ->
{
// The cast is unpleasant, but safe to do so as the upgraded
instance is running the current version.
assertFalse("node " + i.config().num() + " is still in
MIGRATING STATE",
ClusterUtils.isMigrating((IInvokableInstance) i));
});
- cluster.get(2).nodetoolResult("reconfigurecms",
"3").asserts().success();
+ cluster.get(2).nodetoolResult("cms", "reconfigure",
"3").asserts().success();
cluster.schemaChange(withKeyspace("create table %s.xyz (id int
primary key)"));
cluster.forEach(i -> {
Object [][] res = i.executeInternal("select host_id from
system.local");
diff --git
a/test/distributed/org/apache/cassandra/distributed/upgrade/DropCompactStorageTest.java
b/test/distributed/org/apache/cassandra/distributed/upgrade/DropCompactStorageTest.java
index c9872597bc..e60775ee6b 100644
---
a/test/distributed/org/apache/cassandra/distributed/upgrade/DropCompactStorageTest.java
+++
b/test/distributed/org/apache/cassandra/distributed/upgrade/DropCompactStorageTest.java
@@ -42,7 +42,7 @@ public class DropCompactStorageTest extends UpgradeTestBase
cluster.coordinator(1).execute("INSERT INTO " + KEYSPACE + ".tbl
(pk, ck) VALUES (1,1)", ConsistencyLevel.ALL);
})
.runAfterClusterUpgrade((cluster) -> {
- cluster.get(1).nodetoolResult("initializecms").asserts().success();
+ cluster.get(1).nodetoolResult("cms",
"initialize").asserts().success();
cluster.schemaChange("ALTER TABLE " + KEYSPACE + ".tbl DROP
COMPACT STORAGE");
assertRows(cluster.coordinator(1).execute("SELECT * FROM " +
KEYSPACE + ".tbl WHERE pk = 1",
ConsistencyLevel.ALL),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]