Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the correspondingMessagingVersion of SSTable format and improve T…
…TL overflow tests coverage Patch by Jacek Lewandowski; reviewed by Berenguer Blasi for CASSANDRA-19197
- Loading branch information
1 parent
f9ebec9
commit 2fc2be5
Showing
11 changed files
with
432 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...ibuted/org/apache/cassandra/distributed/upgrade/MixedModeTTLOverflowAfterUpgradeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* 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 static org.apache.cassandra.utils.StorageCompatibilityMode.NONE; | ||
import static org.apache.cassandra.utils.StorageCompatibilityMode.UPGRADING; | ||
|
||
public class MixedModeTTLOverflowAfterUpgradeTest extends MixedModeTTLOverflowUpgradeTestBase | ||
{ | ||
@Test | ||
public void testTTLOverflowAfterUpgrade() throws Throwable | ||
{ | ||
testTTLOverflow((cluster, node) -> { | ||
cluster.disableAutoCompaction(KEYSPACE); | ||
if (node == 1) // only node1 is upgraded, and the cluster is in mixed versions mode | ||
{ | ||
verify(Step.NODE1_40_NODE2_PREV, cluster, true); | ||
} | ||
else // both nodes have been upgraded, and the cluster isn't in mixed version mode anymore | ||
{ | ||
verify(Step.NODE1_40_NODE2_40, cluster, true); | ||
|
||
// We restart node1 with compatibility mode UPGRADING | ||
restartNodeWithCompatibilityMode(cluster, 1, UPGRADING); | ||
// since node2 is still in 4.0 compatibility mode, the limit should remain 2038 | ||
verify(Step.NODE1_UPGRADING_NODE2_40, cluster, true); | ||
|
||
// We restart node2 in UPGRADING compatibility mode | ||
restartNodeWithCompatibilityMode(cluster, 2, UPGRADING); | ||
// Both nodes are in UPGRADING compatibility mode, so the limit should be 2106 | ||
verify(Step.NODE1_UPGRADING_NODE2_UPGRADING, cluster, false); | ||
|
||
// We restart the cluster out of compatibility mode, so the limit should be 2106 | ||
restartNodeWithCompatibilityMode(cluster, 1, NONE); | ||
verify(Step.NODE1_NONE_NODE2_UPGRADING, cluster, false); | ||
|
||
restartNodeWithCompatibilityMode(cluster, 2, NONE); | ||
verify(Step.NODE1_NONE_NODE2_NONE, cluster, false); | ||
} | ||
}); | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
...buted/org/apache/cassandra/distributed/upgrade/MixedModeTTLOverflowDuringUpgradeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* 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 static org.apache.cassandra.utils.StorageCompatibilityMode.NONE; | ||
import static org.apache.cassandra.utils.StorageCompatibilityMode.UPGRADING; | ||
|
||
public class MixedModeTTLOverflowDuringUpgradeTest extends MixedModeTTLOverflowUpgradeTestBase | ||
{ | ||
@Test | ||
public void testTTLOverflowDuringUpgrade() throws Throwable | ||
{ | ||
testTTLOverflow((cluster, node) -> { | ||
cluster.disableAutoCompaction(KEYSPACE); | ||
if (node == 1) // only node1 is upgraded, and the cluster is in mixed versions mode | ||
{ | ||
verify(Step.NODE1_40_NODE2_PREV, cluster, true); | ||
|
||
// We restart the upgraded node 1 with compatibility mode = UPGRADING | ||
restartNodeWithCompatibilityMode(cluster, 1, UPGRADING); | ||
// 2038 should still be the limit, because node2 is not upgraded yet | ||
verify(Step.NODE1_UPGRADING_NODE2_PREV, cluster, true); | ||
} | ||
else // both nodes have been upgraded, and the cluster isn't in mixed version mode anymore | ||
{ | ||
// Once we have completed the upgrade, 2038 should still be the limit because | ||
// node2 is still in 4.x compatibility mode | ||
verify(Step.NODE1_UPGRADING_NODE2_40, cluster, true); | ||
|
||
// We restart the last upgraded node in UPGRADING compatibility mode | ||
restartNodeWithCompatibilityMode(cluster, 2, UPGRADING); | ||
// Both nodes are in UPGRADING compatibility mode, so the limit should be 2106 | ||
verify(Step.NODE1_UPGRADING_NODE2_UPGRADING, cluster, false); | ||
|
||
// We restart get both nodes out of compatibility mode, so the limit should be 2106. | ||
restartNodeWithCompatibilityMode(cluster, 1, NONE); | ||
verify(Step.NODE1_NONE_NODE2_UPGRADING, cluster, false); | ||
restartNodeWithCompatibilityMode(cluster, 2, NONE); | ||
verify(Step.NODE1_NONE_NODE2_NONE, cluster, false); | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.