Update SUPPORTED_UPGRADE_PATHS to include 3.0 and 3.x to 4.1 paths and remove obsolete tests

patch by Caleb Rackliffe; reviewed by Mick Semb Wever for CASSANDRA-17362
This commit is contained in:
Caleb Rackliffe 2022-03-10 17:12:47 -06:00
parent f1c1694e43
commit 302c6fcf59
9 changed files with 4 additions and 356 deletions

View File

@ -1,4 +1,5 @@
4.1
* Update SUPPORTED_UPGRADE_PATHS to include 3.0 and 3.x to 4.1 paths and remove obsolete tests (CASSANDRA-17362)
* Support DELETE in CQLSSTableWriter (CASSANDRA-14797)
* Failed inbound internode authentication failures generate ugly warning with stack trace (CASSANDRA-17068)
* Expose gossip information in system_views.gossip_info virtual table (CASSANDRA-17002)

View File

@ -1,41 +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.distributed.upgrade;
import org.junit.Test;
import org.apache.cassandra.distributed.shared.Versions;
/**
* {@link MixedModeAvailabilityTestBase} for upgrades from v22.
*/
public class MixedModeAvailabilityV22Test extends MixedModeAvailabilityTestBase
{
@Test
public void testAvailabilityV22ToV30() throws Throwable
{
testAvailability(v22, v30);
}
@Test
public void testAvailabilityV22ToV3X() throws Throwable
{
testAvailability(v22, v3X);
}
}

View File

@ -1,41 +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.distributed.upgrade;
import org.junit.Test;
import org.apache.cassandra.distributed.shared.Versions;
/**
* {@link MixedModeConsistencyTestBase} for upgrades from v22.
*/
public class MixedModeConsistencyV22Test extends MixedModeConsistencyTestBase
{
@Test
public void testConsistencyV22ToV30() throws Throwable
{
testConsistency(v22, v30);
}
@Test
public void testConsistencyV22ToV3X() throws Throwable
{
testConsistency(v22, v3X);
}
}

View File

@ -1,38 +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.distributed.upgrade;
import org.junit.Test;
import org.apache.cassandra.distributed.shared.Versions;
public class MixedModeFrom2LoggedBatchTest extends MixedModeBatchTestBase
{
@Test
public void testSimpleStrategy22to30() throws Throwable
{
testSimpleStrategy(v22, v30, true);
}
@Test
public void testSimpleStrategy22to3X() throws Throwable
{
testSimpleStrategy(v22, v3X, true);
}
}

View File

@ -1,38 +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.distributed.upgrade;
import org.junit.Test;
import org.apache.cassandra.distributed.shared.Versions;
public class MixedModeFrom2ReplicationTest extends MixedModeReplicationTestBase
{
@Test
public void testSimpleStrategy22to30() throws Throwable
{
testSimpleStrategy(v22, v30);
}
@Test
public void testSimpleStrategy22to3X() throws Throwable
{
testSimpleStrategy(v22, v3X);
}
}

View File

@ -1,38 +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.distributed.upgrade;
import org.junit.Test;
import org.apache.cassandra.distributed.shared.Versions;
public class MixedModeFrom2UnloggedBatchTest extends MixedModeBatchTestBase
{
@Test
public void testSimpleStrategy22to30() throws Throwable
{
testSimpleStrategy(v22, v30, false);
}
@Test
public void testSimpleStrategy22to3X() throws Throwable
{
testSimpleStrategy(v22, v3X, false);
}
}

View File

@ -1,96 +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.distributed.upgrade;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.junit.Test;
import com.datastax.driver.core.ProtocolVersion;
import com.datastax.driver.core.QueryOptions;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.SimpleStatement;
import com.datastax.driver.core.Statement;
import org.apache.cassandra.distributed.api.ConsistencyLevel;
import org.apache.cassandra.distributed.shared.DistributedTestBase;
import org.apache.cassandra.distributed.shared.Versions;
import static org.apache.cassandra.distributed.api.Feature.GOSSIP;
import static org.apache.cassandra.distributed.api.Feature.NATIVE_PROTOCOL;
import static org.apache.cassandra.distributed.api.Feature.NETWORK;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class PagingTest extends UpgradeTestBase
{
@Test
public void testReads() throws Throwable
{
new UpgradeTestBase.TestCase()
.nodes(2)
.upgrades(v22, v30)
.nodesToUpgrade(2)
.withConfig(config -> config.with(GOSSIP, NETWORK, NATIVE_PROTOCOL))
.setup((cluster) -> {
cluster.disableAutoCompaction(DistributedTestBase.KEYSPACE);
cluster.schemaChange("CREATE TABLE " + DistributedTestBase.KEYSPACE + ".tbl (pk int, ck int, v text, PRIMARY KEY (pk, ck)) ");
for (int j = 0; j < 5000; j++)
{
for (int i = 0; i < 10; i++)
cluster.coordinator(1).execute("insert into " + DistributedTestBase.KEYSPACE + ".tbl (pk, ck, v) VALUES (" + j + ", " + i + ", 'hello')", ConsistencyLevel.ALL);
}
cluster.forEach(c -> c.flush(DistributedTestBase.KEYSPACE));
checkDuplicates("BOTH ON 2.2");
})
.runAfterClusterUpgrade((cluster) -> checkDuplicates("MIXED MODE"))
.run();
}
private void checkDuplicates(String message) throws InterruptedException
{
Thread.sleep(5000); // sometimes one node doesn't have time come up properly?
try (com.datastax.driver.core.Cluster c = com.datastax.driver.core.Cluster.builder()
.addContactPoint("127.0.0.1")
.withProtocolVersion(ProtocolVersion.V3)
.withQueryOptions(new QueryOptions().setFetchSize(101))
.build();
Session s = c.connect())
{
Statement stmt = new SimpleStatement("select distinct token(pk) from " + DistributedTestBase.KEYSPACE + ".tbl WHERE token(pk) > " + Long.MIN_VALUE + " AND token(pk) < " + Long.MAX_VALUE);
stmt.setConsistencyLevel(com.datastax.driver.core.ConsistencyLevel.ALL);
ResultSet res = s.execute(stmt);
Set<Object> seenTokens = new HashSet<>();
Iterator<Row> rows = res.iterator();
Set<Object> dupes = new HashSet<>();
while (rows.hasNext())
{
Object token = rows.next().getObject(0);
if (seenTokens.contains(token))
dupes.add(token);
seenTokens.add(token);
}
assertEquals(message+": too few rows", 5000, seenTokens.size());
assertTrue(message+": dupes is not empty", dupes.isEmpty());
}
}
}

View File

@ -1,57 +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.distributed.upgrade;
import org.junit.Test;
import org.apache.cassandra.distributed.api.ConsistencyLevel;
import org.apache.cassandra.distributed.shared.Versions;
public class ReadRepairCompactStorageUpgradeTest extends UpgradeTestBase
{
/**
* Tests {@code COMPACT STORAGE} behaviour with mixed replica versions.
* <p>
* See CASSANDRA-15363 for further details.
*/
@Test
public void mixedModeReadRepairCompactStorage() throws Throwable
{
new TestCase()
.nodes(2)
.upgrades(v22, v3X)
.setup((cluster) -> cluster.schemaChange(withKeyspace("CREATE TABLE %s.tbl" +
" (pk ascii, b boolean, v blob, PRIMARY KEY (pk))" +
" WITH COMPACT STORAGE")))
.runAfterNodeUpgrade((cluster, node) -> {
if (node != 1)
return;
// now node1 is 3.0/3.x and node2 is 2.2
// make sure 2.2 side does not get the mutation
cluster.get(1).executeInternal(withKeyspace("DELETE FROM %s.tbl WHERE pk = ?"), "something");
// trigger a read repair
cluster.coordinator(2).execute(withKeyspace("SELECT * FROM %s.tbl WHERE pk = ?"),
ConsistencyLevel.ALL,
"something");
cluster.get(2).flush(KEYSPACE);
})
.runAfterClusterUpgrade((cluster) -> cluster.get(2).forceCompact(KEYSPACE, "tbl"))
.run();
}
}

View File

@ -44,14 +44,11 @@ import org.apache.cassandra.distributed.shared.DistributedTestBase;
import org.apache.cassandra.distributed.shared.ThrowingRunnable;
import org.apache.cassandra.distributed.shared.Versions;
import org.apache.cassandra.utils.ByteBufferUtil;
import org.apache.cassandra.utils.FBUtilities;
import org.apache.cassandra.utils.Pair;
import static org.apache.cassandra.distributed.shared.Versions.Version;
import static org.apache.cassandra.distributed.shared.Versions.find;
public class UpgradeTestBase extends DistributedTestBase
{
private static final Logger logger = LoggerFactory.getLogger(UpgradeTestBase.class);
@ -85,18 +82,17 @@ public class UpgradeTestBase extends DistributedTestBase
public void run(UpgradeableCluster cluster, int node) throws Throwable;
}
public static final Semver v22 = new Semver("2.2.0-beta1", SemverType.LOOSE);
public static final Semver v30 = new Semver("3.0.0-alpha1", SemverType.LOOSE);
public static final Semver v3X = new Semver("3.11.0", SemverType.LOOSE);
public static final Semver v40 = new Semver("4.0-alpha1", SemverType.LOOSE);
public static final Semver v41 = new Semver("4.1-alpha1", SemverType.LOOSE);
protected static final List<Pair<Semver,Semver>> SUPPORTED_UPGRADE_PATHS = ImmutableList.of(
Pair.create(v22, v30),
Pair.create(v22, v3X),
Pair.create(v30, v3X),
Pair.create(v30, v40),
Pair.create(v30, v41),
Pair.create(v3X, v40),
Pair.create(v3X, v41),
Pair.create(v40, v41));
// the last is always the current
@ -267,7 +263,7 @@ public class UpgradeTestBase extends DistributedTestBase
protected TestCase allUpgrades(int nodes, int... toUpgrade)
{
return new TestCase().nodes(nodes)
.upgradesFrom(v22)
.upgradesFrom(v30)
.nodesToUpgrade(toUpgrade);
}