You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/01/26 17:10:57 UTC

[GitHub] [cassandra] adelapena commented on a change in pull request #873: CASSANDRA-16244 Create a jvm upgrade dtest for mixed versions repairs

adelapena commented on a change in pull request #873:
URL: https://github.com/apache/cassandra/pull/873#discussion_r564682475



##########
File path: test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeRepairTest.java
##########
@@ -0,0 +1,113 @@
+/*
+ * 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.distributed.upgrade;
+
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import org.apache.cassandra.distributed.UpgradeableCluster;
+import org.apache.cassandra.distributed.api.IUpgradeableInstance;
+
+import static org.apache.cassandra.distributed.api.Feature.GOSSIP;
+import static org.apache.cassandra.distributed.api.Feature.NETWORK;
+import static org.apache.cassandra.distributed.shared.AssertUtils.assertEquals;
+import static org.apache.cassandra.distributed.shared.AssertUtils.assertNotEquals;
+import static org.apache.cassandra.distributed.shared.AssertUtils.assertRows;
+import static org.apache.cassandra.distributed.shared.AssertUtils.row;
+import static org.apache.cassandra.distributed.shared.ClusterUtils.awaitRingJoin;
+import static org.apache.cassandra.distributed.shared.Versions.Major;
+
+/**
+ * Tests that repair only works on mixed mode clusters if there isn't a major upgrade. Otherwise, repair attempts will
+ * be rejected with an informative message.
+ */
+public class MixedModeRepairTest extends UpgradeTestBase
+{
+    public static final String CREATE_TABLE = withKeyspace("CREATE TABLE %s.t (k uuid, c int, v int, PRIMARY KEY (k, c))");
+    public static final String INSERT = withKeyspace("INSERT INTO %s.t (k, c, v) VALUES (?, ?, ?)");
+    public static final String SELECT = withKeyspace("SELECT * FROM %s.t WHERE k=?");
+
+    @Test
+    public void testMixedModeRepair() throws Throwable
+    {
+        new UpgradeTestBase.TestCase()
+        .nodes(2)
+        .nodesToUpgrade(2)
+        .upgrade(Major.v30, Major.v4)
+        .upgrade(Major.v3X, Major.v4)
+        .withConfig(config -> config.with(NETWORK, GOSSIP))
+        .setup(cluster -> cluster.schemaChange(withKeyspace(CREATE_TABLE)))

Review comment:
       Good catches, fixed as suggested.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org