Skip to content
Permalink
Browse files
Remove unecessary DROP COMPACT STORAGE
  • Loading branch information
blerer committed Jun 22, 2021
1 parent 7a73630 commit a53506281883841dc824e48595668771728a7258
Showing 6 changed files with 28 additions and 174 deletions.

Large diffs are not rendered by default.

@@ -50,6 +50,7 @@ def upgrade_node(self, node, to_version):
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')
@@ -471,9 +471,6 @@ def test_basic_paging(self):
) 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 @@ def test_basic_compound_paging(self):
) 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")
@@ -140,10 +140,6 @@ def upgrade_with_clustered_table(self, compact_storage=False):
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 @@ def upgrade_with_unclustered_table(self, compact_storage=False):
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)
@@ -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 @@ def prepare(self, start_version, num_nodes=1, rf=1):
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 @@ def _do_rolling_upgrade(self, after_each_upgrade=None):
"""
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 @@ def test_sparse_supercolumn(self):
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
@@ -128,8 +128,6 @@ def _upgrade_super_columns_through_versions_test(self, upgrade_path):
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)

0 comments on commit a535062

Please sign in to comment.