This is an automated email from the ASF dual-hosted git repository.
adelapena pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git
The following commit(s) were added to refs/heads/trunk by this push:
new 7542dfe Fix test_counters upgrade test for 4.0
7542dfe is described below
commit 7542dfe3921089dae35c2ab70616a7fb1f526fe8
Author: Andrés de la Peña <[email protected]>
AuthorDate: Wed May 12 20:48:23 2021 +0100
Fix test_counters upgrade test for 4.0
patch by Andrés de la Peña; reviewed by Ekaterina Dimitrova for
CASSANDRA-16653
---
upgrade_tests/cql_tests.py | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/upgrade_tests/cql_tests.py b/upgrade_tests/cql_tests.py
index c2bfe99..eac6ec2 100644
--- a/upgrade_tests/cql_tests.py
+++ b/upgrade_tests/cql_tests.py
@@ -461,18 +461,26 @@ class TestCQL(UpgradeTester):
""" Validate counter support """
cursor = self.prepare()
- cursor.execute("""
+ logger.debug('*** VERSION FAMILY: ' +
str(self.UPGRADE_PATH.upgrade_meta.family))
+ logger.debug('*** VERSION: ' + str(self.cluster.version()))
+
+ create_table_query = """
CREATE TABLE clicks (
userid int,
url text,
total counter,
PRIMARY KEY (userid, url)
- ) WITH COMPACT STORAGE;
- """)
+ )
+ """
- #4.0 doesn't support compact storage
- if self.is_40_or_greater():
- cursor.execute("ALTER TABLE clicks DROP COMPACT STORAGE;")
+ if self.cluster.version() >= LooseVersion('4.0'):
+ cursor.execute(create_table_query)
+ 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"))
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]