adelapena commented on code in PR #1891:
URL: https://github.com/apache/cassandra/pull/1891#discussion_r1185996004


##########
test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeTTLOverflowUpgradeTest.java:
##########
@@ -0,0 +1,114 @@
+/*
+ * 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.config.CassandraRelevantProperties;
+import org.apache.cassandra.cql3.Attributes;
+import org.apache.cassandra.db.rows.Cell;
+import org.apache.cassandra.distributed.api.ICoordinator;
+import org.apache.cassandra.io.sstable.format.big.BigFormat;
+import org.apache.cassandra.utils.Clock;
+import org.assertj.core.api.Assertions;
+
+import static org.apache.cassandra.distributed.api.ConsistencyLevel.ALL;
+
+/**
+ * Tests TTL the overflow policy triggers at the correct limit: year 2038 <=nc 
or 2186 >nc
+ *
+ * <=nc overflow policy triggers at year 2038. That could be <=4.1 or 5.0 with 
nc sstable format
+ * >nc overflow policy triggers at year 2106. That is >=5.0 and using >=oa 
sstable format
+ * See BigFormat.USE_OA_SSTABLE_FORMAT
+ */
+public class MixedModeTTLOverflowUpgradeTest extends UpgradeTestBase
+{   
+    @Test
+    public void testTTLOverflowDuringUpgrade() throws Throwable
+    {
+        new TestCase()
+        .nodes(2)
+        .nodesToUpgradeOrdered(1, 2)
+        .upgradesToCurrentFrom(v41)
+        .setup(cluster -> {
+            cluster.schemaChange(withKeyspace("CREATE TABLE %s.t (k int 
PRIMARY KEY, v int)"));
+
+            assertPolicyTriggersAt2038(cluster.coordinator(1));
+            assertPolicyTriggersAt2038(cluster.coordinator(2));
+        })
+        .runAfterNodeUpgrade((cluster, node) -> {
+            if (node == 1) // only node1 is upgraded, and the cluster is in 
mixed versions mode
+            {
+                assertPolicyTriggersAt2038(cluster.coordinator(1));
+                assertPolicyTriggersAt2038(cluster.coordinator(2));

Review Comment:
   We are not testing the scenario where there is a node in 5.0 compatible with 
4.0 and another node still in 4.0. I have added that case in the commit 
changing the system property to `cassandra.storage_compatibility_version` that 
I mentioned above, 
https://github.com/adelapena/cassandra/commit/0a87f1ee13e5eed92dee637638667a30695c3426



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to