You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by bl...@apache.org on 2021/06/22 14:04:51 UTC

[cassandra-dtest] branch trunk updated (7a73630 -> 7c42b70)

This is an automated email from the ASF dual-hosted git repository.

blerer pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git.


    from 7a73630  Tests changes for CASSANDRA-16733
     new a535062  Remove unecessary DROP COMPACT STORAGE
     new 7c42b70  Enable DROP COMPACT for thrift upgrade tests

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 upgrade_tests/cql_tests.py                         | 169 +++------------------
 upgrade_tests/drop_compact_storage_upgrade_test.py |   1 +
 upgrade_tests/paging_test.py                       |   6 -
 upgrade_tests/storage_engine_upgrade_test.py       |  18 +--
 upgrade_tests/thrift_upgrade_test.py               |  18 +--
 upgrade_tests/upgrade_supercolumns_test.py         |   2 -
 6 files changed, 35 insertions(+), 179 deletions(-)

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


[cassandra-dtest] 01/02: Remove unecessary DROP COMPACT STORAGE

Posted by bl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

blerer pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git

commit a53506281883841dc824e48595668771728a7258
Author: Benjamin Lerer <b....@gmail.com>
AuthorDate: Mon Jun 21 11:28:49 2021 +0200

    Remove unecessary DROP COMPACT STORAGE
---
 upgrade_tests/cql_tests.py                         | 169 +++------------------
 upgrade_tests/drop_compact_storage_upgrade_test.py |   1 +
 upgrade_tests/paging_test.py                       |   6 -
 upgrade_tests/storage_engine_upgrade_test.py       |  18 +--
 upgrade_tests/thrift_upgrade_test.py               |   6 +-
 upgrade_tests/upgrade_supercolumns_test.py         |   2 -
 6 files changed, 28 insertions(+), 174 deletions(-)

diff --git a/upgrade_tests/cql_tests.py b/upgrade_tests/cql_tests.py
index eac6ec2..e6a3b97 100644
--- a/upgrade_tests/cql_tests.py
+++ b/upgrade_tests/cql_tests.py
@@ -132,10 +132,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE;
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE users DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE users")
@@ -147,25 +143,16 @@ class TestCQL(UpgradeTester):
             # Queries
             assert_one(cursor, "SELECT firstname, lastname FROM users WHERE userid = 550e8400-e29b-41d4-a716-446655440000", ['Frodo', 'Baggins'])
 
-            if self.is_40_or_greater():
-                assert_one(cursor, "SELECT * FROM users WHERE userid = 550e8400-e29b-41d4-a716-446655440000",
-                           [UUID('550e8400-e29b-41d4-a716-446655440000'), None, 32, 'Frodo', 'Baggins', None])
-                assert_one(cursor, "SELECT * FROM users WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479",
-                           [UUID('f47ac10b-58cc-4372-a567-0e02b2c3d479'), None, 33, 'Samwise', 'Gamgee', None])
-                assert_all(cursor, "SELECT * FROM users",
-                           [[UUID('f47ac10b-58cc-4372-a567-0e02b2c3d479'), None, 33, 'Samwise', 'Gamgee', None],
-                            [UUID('550e8400-e29b-41d4-a716-446655440000'), None, 32, 'Frodo', 'Baggins', None]])
-            else:
-                assert_one(cursor, "SELECT * FROM users WHERE userid = 550e8400-e29b-41d4-a716-446655440000",
-                           [UUID('550e8400-e29b-41d4-a716-446655440000'), 32, 'Frodo', 'Baggins'])
-                # FIXME There appears to be some sort of problem with reusable cells
-                # when executing this query.  It's likely that CASSANDRA-9705 will
-                # fix this, but I'm not 100% sure.
-                assert_one(cursor, "SELECT * FROM users WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479",
-                           [UUID('f47ac10b-58cc-4372-a567-0e02b2c3d479'), 33, 'Samwise', 'Gamgee'])
-                assert_all(cursor, "SELECT * FROM users",
-                           [[UUID('f47ac10b-58cc-4372-a567-0e02b2c3d479'), 33, 'Samwise', 'Gamgee'],
-                            [UUID('550e8400-e29b-41d4-a716-446655440000'), 32, 'Frodo', 'Baggins']])
+            assert_one(cursor, "SELECT * FROM users WHERE userid = 550e8400-e29b-41d4-a716-446655440000",
+                       [UUID('550e8400-e29b-41d4-a716-446655440000'), 32, 'Frodo', 'Baggins'])
+            # FIXME There appears to be some sort of problem with reusable cells
+            # when executing this query.  It's likely that CASSANDRA-9705 will
+            # fix this, but I'm not 100% sure.
+            assert_one(cursor, "SELECT * FROM users WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479",
+                       [UUID('f47ac10b-58cc-4372-a567-0e02b2c3d479'), 33, 'Samwise', 'Gamgee'])
+            assert_all(cursor, "SELECT * FROM users",
+                       [[UUID('f47ac10b-58cc-4372-a567-0e02b2c3d479'), 33, 'Samwise', 'Gamgee'],
+                        [UUID('550e8400-e29b-41d4-a716-446655440000'), 32, 'Frodo', 'Baggins']])
 
             # Test batch inserts
             cursor.execute("""
@@ -177,12 +164,8 @@ class TestCQL(UpgradeTester):
                 APPLY BATCH
             """)
 
-            if self.is_40_or_greater():
-                assert_all(cursor, "SELECT * FROM users", [[UUID('f47ac10b-58cc-4372-a567-0e02b2c3d479'), None, 37, None, None, None],
-                                                           [UUID('550e8400-e29b-41d4-a716-446655440000'), None, 36, None, None, None]])
-            else:
-                assert_all(cursor, "SELECT * FROM users", [[UUID('f47ac10b-58cc-4372-a567-0e02b2c3d479'), 37, None, None],
-                                                           [UUID('550e8400-e29b-41d4-a716-446655440000'), 36, None, None]])
+            assert_all(cursor, "SELECT * FROM users", [[UUID('f47ac10b-58cc-4372-a567-0e02b2c3d479'), 37, None, None],
+                                                       [UUID('550e8400-e29b-41d4-a716-446655440000'), 36, None, None]])
 
     def test_dynamic_cf(self):
         """ Test non-composite dynamic CF syntax """
@@ -197,10 +180,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE;
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE clicks DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE clicks")
@@ -240,10 +219,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE;
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE connections DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE connections")
@@ -255,12 +230,8 @@ class TestCQL(UpgradeTester):
             cursor.execute("UPDATE connections SET time = 24 WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479 AND ip = '192.168.0.2' AND port = 80")
 
             # we don't have to include all of the clustering columns (see CASSANDRA-7990)
-            if self.is_40_or_greater():
-                cursor.execute("INSERT INTO connections (userid, ip, port, time) VALUES (f47ac10b-58cc-4372-a567-0e02b2c3d479, '192.168.0.3', 80, 42)")
-                cursor.execute("UPDATE connections SET time = 42 WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479 AND ip = '192.168.0.4' AND port = 90")
-            else:
-                cursor.execute("INSERT INTO connections (userid, ip, time) VALUES (f47ac10b-58cc-4372-a567-0e02b2c3d479, '192.168.0.3', 42)")
-                cursor.execute("UPDATE connections SET time = 42 WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479 AND ip = '192.168.0.4'")
+            cursor.execute("INSERT INTO connections (userid, ip, time) VALUES (f47ac10b-58cc-4372-a567-0e02b2c3d479, '192.168.0.3', 42)")
+            cursor.execute("UPDATE connections SET time = 42 WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479 AND ip = '192.168.0.4'")
 
             # Queries
             assert_all(cursor, "SELECT ip, port, time FROM connections WHERE userid = 550e8400-e29b-41d4-a716-446655440000",
@@ -274,23 +245,17 @@ class TestCQL(UpgradeTester):
 
             assert_none(cursor, "SELECT ip, port, time FROM connections WHERE userid = 550e8400-e29b-41d4-a716-446655440000 and ip > '192.168.0.2'")
 
-            if self.is_40_or_greater():
-                assert_one(cursor, "SELECT ip, port, time FROM connections WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479 AND ip = '192.168.0.3'",
-                           ['192.168.0.3', 80, 42])
-                assert_one(cursor, "SELECT ip, port, time FROM connections WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479 AND ip = '192.168.0.4'",
-                           ['192.168.0.4', 90, 42])
-            else:
-                assert_one(cursor, "SELECT ip, port, time FROM connections WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479 AND ip = '192.168.0.3'",
-                           ['192.168.0.3', None, 42])
-                assert_one(cursor, "SELECT ip, port, time FROM connections WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479 AND ip = '192.168.0.4'",
-                           ['192.168.0.4', None, 42])
+            assert_one(cursor, "SELECT ip, port, time FROM connections WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479 AND ip = '192.168.0.3'",
+                       ['192.168.0.3', None, 42])
+            assert_one(cursor, "SELECT ip, port, time FROM connections WHERE userid = f47ac10b-58cc-4372-a567-0e02b2c3d479 AND ip = '192.168.0.4'",
+                       ['192.168.0.4', None, 42])
 
             # Deletion
             cursor.execute("DELETE time FROM connections WHERE userid = 550e8400-e29b-41d4-a716-446655440000 AND ip = '192.168.0.2' AND port = 80")
 
             res = list(cursor.execute("SELECT * FROM connections WHERE userid = 550e8400-e29b-41d4-a716-446655440000"))
             #Without compact storage deleting just the column leaves the row behind
-            assert_length_equal(res, 3 if self.is_40_or_greater() else 2)
+            assert_length_equal(res, 2)
 
             cursor.execute("DELETE FROM connections WHERE userid = 550e8400-e29b-41d4-a716-446655440000")
             assert_none(cursor, "SELECT * FROM connections WHERE userid = 550e8400-e29b-41d4-a716-446655440000")
@@ -351,10 +316,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE;
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE clicks DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE clicks")
@@ -382,10 +343,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE;
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE clicks DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE clicks")
@@ -478,10 +435,6 @@ class TestCQL(UpgradeTester):
         else:
             cursor.execute(create_table_query + '  WITH COMPACT STORAGE')
 
-            # 4.0 doesn't support compact storage
-            if self.is_40_or_greater():
-                cursor.execute("ALTER TABLE clicks DROP COMPACT STORAGE")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE clicks")
@@ -577,10 +530,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE;
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE test DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE test")
@@ -629,11 +578,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE;
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE test1 DROP COMPACT STORAGE;")
-            cursor.execute("ALTER TABLE test2 DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE test1")
@@ -683,10 +627,6 @@ class TestCQL(UpgradeTester):
             );
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE test1 DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE test1")
@@ -738,11 +678,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE Test DROP COMPACT STORAGE;")
-            cursor.execute("ALTER TABLE test2 DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE test")
@@ -980,10 +915,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE;
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE testcf2 DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE testcf")
@@ -1756,10 +1687,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE test2 DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE test")
@@ -1779,8 +1706,7 @@ class TestCQL(UpgradeTester):
                     cursor.execute(q, (k, c))
 
             query = "SELECT * FROM test2"
-            expected = [[x, y, None] for x in range(0, 2) for y in range(0, 2)] if self.is_40_or_greater() else [
-                [x, y] for x in range(0, 2) for y in range(0, 2)]
+            expected = [[x, y] for x in range(0, 2) for y in range(0, 2)]
             assert_all(cursor, query, expected)
 
     def test_no_clustering(self):
@@ -2132,11 +2058,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE;
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE test1 DROP COMPACT STORAGE;")
-            cursor.execute("ALTER TABLE test2 DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE test1")
@@ -2202,10 +2123,6 @@ class TestCQL(UpgradeTester):
                   AND CLUSTERING ORDER BY(c1 DESC, c2 DESC);
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE test DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE test")
@@ -2596,10 +2513,6 @@ class TestCQL(UpgradeTester):
 
         cursor.execute(create)
 
-        #4.0 doesn't support compact storage
-        if compact and self.is_40_or_greater():
-            cursor.execute("ALTER TABLE zipcodes DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE zipcodes")
@@ -2654,10 +2567,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE test DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE test")
@@ -2782,16 +2691,12 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE;
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE bar DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE bar")
 
             cursor.execute("INSERT INTO bar (id, i) VALUES (1, 2);")
-            assert_one(cursor, "SELECT * FROM bar", [1, None, 2, None] if self.is_40_or_greater() else [1, 2])
+            assert_one(cursor, "SELECT * FROM bar", [1, 2])
 
     def test_query_compact_tables_during_upgrade(self):
         """
@@ -2819,10 +2724,6 @@ class TestCQL(UpgradeTester):
                                      [(i, i) for i in range(100)])
         self.cluster.flush()
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE t1 DROP COMPACT STORAGE;")
-
         def check_read_all(cursor):
             read_count = 0
             # first read each row separately - obviously, we should be able to retrieve all 100
@@ -3376,10 +3277,6 @@ class TestCQL(UpgradeTester):
         # Same test, but for compact
         cursor.execute("CREATE TABLE test_compact (k1 int, k2 int, v int, PRIMARY KEY (k1, k2)) WITH COMPACT STORAGE")
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE test_compact DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE test")
@@ -3450,11 +3347,6 @@ class TestCQL(UpgradeTester):
         # Test a 'wide row' thrift table.
         cursor.execute('CREATE TABLE wide (pk int, name text, val int, PRIMARY KEY(pk, name)) WITH COMPACT STORAGE')
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE compact DROP COMPACT STORAGE;")
-            cursor.execute("ALTER TABLE wide DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE regular")
@@ -4421,10 +4313,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE lock DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE lock")
@@ -4997,10 +4885,6 @@ class TestCQL(UpgradeTester):
             ) WITH COMPACT STORAGE
         """)
 
-        #4.0 doesn't support compact storage
-        if self.is_40_or_greater():
-            cursor.execute("ALTER TABLE test DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying {} node".format("upgraded" if is_upgraded else "old"))
             cursor.execute("TRUNCATE test")
@@ -5012,14 +4896,9 @@ class TestCQL(UpgradeTester):
             assert_all(cursor, "SELECT v FROM test WHERE k=0 AND v > 0 AND v <= 4 LIMIT 2", [[1], [2]])
             assert_all(cursor, "SELECT v FROM test WHERE k=0 AND v > -1 AND v <= 4 LIMIT 2", [[0], [1]])
 
-            if self.is_40_or_greater():
-                assert_all(cursor, "SELECT * FROM test WHERE k IN (0, 1, 2) AND v > 0 AND v <= 4 LIMIT 2", [[0, 1, None], [0, 2, None]])
-                assert_all(cursor, "SELECT * FROM test WHERE k IN (0, 1, 2) AND v > -1 AND v <= 4 LIMIT 2", [[0, 0, None], [0, 1, None]])
-                assert_all(cursor, "SELECT * FROM test WHERE k IN (0, 1, 2) AND v > 0 AND v <= 4 LIMIT 6", [[0, 1, None], [0, 2, None], [0, 3, None], [1, 1, None], [1, 2, None], [1, 3, None]])
-            else:
-                assert_all(cursor, "SELECT * FROM test WHERE k IN (0, 1, 2) AND v > 0 AND v <= 4 LIMIT 2", [[0, 1], [0, 2]])
-                assert_all(cursor, "SELECT * FROM test WHERE k IN (0, 1, 2) AND v > -1 AND v <= 4 LIMIT 2", [[0, 0], [0, 1]])
-                assert_all(cursor, "SELECT * FROM test WHERE k IN (0, 1, 2) AND v > 0 AND v <= 4 LIMIT 6", [[0, 1], [0, 2], [0, 3], [1, 1], [1, 2], [1, 3]])
+            assert_all(cursor, "SELECT * FROM test WHERE k IN (0, 1, 2) AND v > 0 AND v <= 4 LIMIT 2", [[0, 1], [0, 2]])
+            assert_all(cursor, "SELECT * FROM test WHERE k IN (0, 1, 2) AND v > -1 AND v <= 4 LIMIT 2", [[0, 0], [0, 1]])
+            assert_all(cursor, "SELECT * FROM test WHERE k IN (0, 1, 2) AND v > 0 AND v <= 4 LIMIT 6", [[0, 1], [0, 2], [0, 3], [1, 1], [1, 2], [1, 3]])
 
             # This doesn't work -- see #7059
             # assert_all(cursor, "SELECT * FROM test WHERE v > 1 AND v <= 3 LIMIT 6 ALLOW FILTERING", [[1, 2], [1, 3], [0, 2], [0, 3], [2, 2], [2, 3]])
diff --git a/upgrade_tests/drop_compact_storage_upgrade_test.py b/upgrade_tests/drop_compact_storage_upgrade_test.py
index 848aab9..d242de1 100644
--- a/upgrade_tests/drop_compact_storage_upgrade_test.py
+++ b/upgrade_tests/drop_compact_storage_upgrade_test.py
@@ -50,6 +50,7 @@ class TestDropCompactStorage(Tester):
         node.stop(wait_other_notice=False)
 
         node.set_install_dir(version=to_version)
+        node.set_configuration_options(values={'enable_drop_compact_storage': 'true'})
         node.start(wait_other_notice=False, wait_for_binary_proto=False, verbose=False)
 
     @since('3.0', max_version='3.11')
diff --git a/upgrade_tests/paging_test.py b/upgrade_tests/paging_test.py
index 7c3bd37..57106b0 100644
--- a/upgrade_tests/paging_test.py
+++ b/upgrade_tests/paging_test.py
@@ -471,9 +471,6 @@ class TestPagingData(BasePagingTester, PageAssertionMixin):
                 ) WITH COMPACT STORAGE;
             """)
 
-        if testing_compact_storage and self.upgrade_is_version_4_or_greater():  # 4.0 doesn't support compact storage
-            cursor.execute("ALTER TABLE test2 DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying %s node" % ("upgraded" if is_upgraded else "old",))
             cursor.execute("TRUNCATE test")
@@ -525,9 +522,6 @@ class TestPagingData(BasePagingTester, PageAssertionMixin):
                 ) WITH COMPACT STORAGE;
             """)
 
-        if testing_compact_storage and self.upgrade_is_version_4_or_greater():  # 4.0 doesn't support compact storage
-            cursor.execute("ALTER TABLE test2 DROP COMPACT STORAGE;")
-
         for is_upgraded, cursor in self.do_upgrade(cursor):
             logger.debug("Querying %s node" % ("upgraded" if is_upgraded else "old",))
             cursor.execute("TRUNCATE test")
diff --git a/upgrade_tests/storage_engine_upgrade_test.py b/upgrade_tests/storage_engine_upgrade_test.py
index 8112fa2..f5303fc 100644
--- a/upgrade_tests/storage_engine_upgrade_test.py
+++ b/upgrade_tests/storage_engine_upgrade_test.py
@@ -140,10 +140,6 @@ class TestStorageEngineUpgrade(Tester):
             for r in range(ROWS):
                 session.execute("INSERT INTO t(k, t, v) VALUES ({n}, {r}, {r})".format(n=n, r=r))
 
-        #4.0 doesn't support compact storage
-        if compact_storage and self.dtest_config.cassandra_version_from_build >= MAJOR_VERSION_4:
-            session.execute("ALTER TABLE t DROP COMPACT STORAGE;")
-
         session = self._do_upgrade()
 
         for n in range(PARTITIONS):
@@ -213,25 +209,15 @@ class TestStorageEngineUpgrade(Tester):
         for n in range(PARTITIONS):
             session.execute("INSERT INTO t(k, v1, v2, v3, v4) VALUES ({}, {}, {}, {}, {})".format(n, n + 1, n + 2, n + 3, n + 4))
 
-        is40 = self.dtest_config.cassandra_version_from_build >= MAJOR_VERSION_4
-        if compact_storage and is40:
-            session.execute("ALTER TABLE t DROP COMPACT STORAGE;")
-
         session = self._do_upgrade()
 
-        def maybe_add_compact_columns(expected):
-            if is40 and compact_storage:
-                expected.insert(1, None)
-                expected.append(None)
-            return expected
-
         for n in range(PARTITIONS):
-            assert_one(session, "SELECT * FROM t WHERE k = {}".format(n), maybe_add_compact_columns([n, n + 1, n + 2, n + 3, n + 4]))
+            assert_one(session, "SELECT * FROM t WHERE k = {}".format(n), [n, n + 1, n + 2, n + 3, n + 4])
 
         self.cluster.compact()
 
         for n in range(PARTITIONS):
-            assert_one(session, "SELECT * FROM t WHERE k = {}".format(n), maybe_add_compact_columns([n, n + 1, n + 2, n + 3, n + 4]))
+            assert_one(session, "SELECT * FROM t WHERE k = {}".format(n), [n, n + 1, n + 2, n + 3, n + 4])
 
     def test_upgrade_with_statics(self):
         self.upgrade_with_statics(rows=10)
diff --git a/upgrade_tests/thrift_upgrade_test.py b/upgrade_tests/thrift_upgrade_test.py
index 3da44f7..0e33de6 100644
--- a/upgrade_tests/thrift_upgrade_test.py
+++ b/upgrade_tests/thrift_upgrade_test.py
@@ -380,7 +380,6 @@ class TestUpgradeTo40(Tester):
     Thrift is dead in 4.0. However, we still want to ensure users that used thrift
      in 3.0 or earlier have an upgrade path to 4.0 and this class provides tests
      cases for this.
-
      Note that we don't want to run this if the "current" version (the one we're
      upgrading to) is not 4.0 or more, as the tests makes assumptions on that.
     """
@@ -389,7 +388,6 @@ class TestUpgradeTo40(Tester):
         Prepare the test, starting a cluster on the initial version, creating
         a keyspace (named 'ks') and returning a CQL and a thrift connection to
         the first node (and set on the created keyspace).
-
         :param start_version: the version to set the node at initially.
         :param num_nodes: the number of nodes to use.
         :param rf: replication factor for the keyspace created.
@@ -427,7 +425,6 @@ class TestUpgradeTo40(Tester):
         """
         Upgrade all the nodes in the cluster to the "current" version (so 4.0+)
         in a rolling fashion.
-
         :param after_each_upgrade: if not None, a function that is called with 2
           arguments (in that order):
           - the index of the node we just upgraded.
@@ -563,7 +560,6 @@ class TestThrift(UpgradeTester):
     """
     Verify dense and sparse supercolumn functionality with and without renamed columns
     in 3.X after upgrading from 2.x.
-
     @jira_ticket CASSANDRA-12373
     """
 
@@ -738,4 +734,4 @@ for spec in specs:
     cls = type(gen_class_name, (TestThrift,), spec)
     if not upgrade_applies_to_env:
         add_skip(cls, 'test not applicable to env.')
-    globals()[gen_class_name] = cls
+    globals()[gen_class_name] = cls
\ No newline at end of file
diff --git a/upgrade_tests/upgrade_supercolumns_test.py b/upgrade_tests/upgrade_supercolumns_test.py
index f620e70..af22e80 100644
--- a/upgrade_tests/upgrade_supercolumns_test.py
+++ b/upgrade_tests/upgrade_supercolumns_test.py
@@ -128,8 +128,6 @@ class TestSCUpgrade(Tester):
         self.verify_with_thrift()
 
         for version in upgrade_path:
-            if LooseVersion(version.family) >= CASSANDRA_4_0:
-                session.execute("ALTER TABLE supcols.cols DROP COMPACT STORAGE")
             self.upgrade_to_version(version.version)
 
             session = self.patient_exclusive_cql_connection(node1)

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


[cassandra-dtest] 02/02: Enable DROP COMPACT for thrift upgrade tests

Posted by bl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

blerer pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git

commit 7c42b70fe58ceb055f0d6785297e7c8780d89277
Author: Benjamin Lerer <b....@gmail.com>
AuthorDate: Tue Jun 22 11:05:00 2021 +0200

    Enable DROP COMPACT for thrift upgrade tests
---
 upgrade_tests/thrift_upgrade_test.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/upgrade_tests/thrift_upgrade_test.py b/upgrade_tests/thrift_upgrade_test.py
index 0e33de6..2cd6314 100644
--- a/upgrade_tests/thrift_upgrade_test.py
+++ b/upgrade_tests/thrift_upgrade_test.py
@@ -20,7 +20,6 @@ from .upgrade_manifest import build_upgrade_pairs, CASSANDRA_4_0
 since = pytest.mark.since
 logger = logging.getLogger(__name__)
 
-
 def _create_dense_super_cf(thrift, name):
     cfdef = Cassandra.CfDef('ks', name, column_type='Super',
                            key_validation_class='AsciiType',        # pk
@@ -205,12 +204,12 @@ class TestUpgradeSuperColumnsThrough(Tester):
         # Update Cassandra Directory
         for node in nodes:
             node.set_install_dir(version=tag)
-            node.set_configuration_options(values={'start_rpc': 'true'})
+            node.set_configuration_options(values={'start_rpc': 'true', 'enable_drop_compact_storage': 'true'})
             logger.debug("Set new cassandra dir for %s: %s" % (node.name, node.get_install_dir()))
         self.cluster.set_install_dir(version=tag)
         self.fixture_dtest_setup.reinitialize_cluster_for_different_version()
         for node in nodes:
-            node.set_configuration_options(values={'start_rpc': 'true'})
+            node.set_configuration_options(values={'start_rpc': 'true', 'enable_drop_compact_storage': 'true'})
 
         # Restart nodes on new version
         for node in nodes:
@@ -229,7 +228,10 @@ class TestUpgradeSuperColumnsThrough(Tester):
 
         cluster.populate(num_nodes)
         for node in self.cluster.nodelist():
-            node.set_configuration_options(values={'start_rpc': 'true'})
+            if (cassandra_version > "github:apache/cassandra-2.2"):
+                node.set_configuration_options(values={'start_rpc': 'true', 'enable_drop_compact_storage': 'true'})
+            else:
+                node.set_configuration_options(values={'start_rpc': 'true'})
 
         cluster.start()
         return cluster
@@ -399,7 +401,7 @@ class TestUpgradeTo40(Tester):
 
         self.cluster.populate(num_nodes)
         for node in self.cluster.nodelist():
-            node.set_configuration_options(values={'start_rpc': 'true'})
+            node.set_configuration_options(values={'start_rpc': 'true', 'enable_drop_compact_storage': 'true'})
 
         self.cluster.start()
         logger.debug("Started node on %s", start_version)

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