-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cluster helper func): double quoting in keyspace names #10027
base: master
Are you sure you want to change the base?
Conversation
7b68a8a
to
6151785
Compare
6151785
to
85691fd
Compare
sdcm/cluster.py
Outdated
@@ -4491,7 +4491,7 @@ def get_test_keyspaces(self, db_node=None): | |||
"""Function returning a list of non-system keyspaces (created by test)""" | |||
db_node = db_node or self.nodes[0] | |||
keyspaces = db_node.run_cqlsh("describe keyspaces").stdout.split() | |||
return [ks for ks in keyspaces if not is_system_keyspace(ks)] | |||
return [ks.strip('"') for ks in keyspaces if not is_system_keyspace(ks)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you still need to make sure all the usages are using cql_quote_if_needed
as needed when using it in CQL statements
maybe it's time to have cql_unquote_if_needed
? so it would be a bit more clear ?
85691fd
to
94a328d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified places where it is used - and I think some places need to be fixed - see comments.
sdcm/cluster.py
Outdated
@@ -4491,7 +4491,7 @@ def get_test_keyspaces(self, db_node=None): | |||
"""Function returning a list of non-system keyspaces (created by test)""" | |||
db_node = db_node or self.nodes[0] | |||
keyspaces = db_node.run_cqlsh("describe keyspaces").stdout.split() | |||
return [ks for ks in keyspaces if not is_system_keyspace(ks)] | |||
return [ks.strip('"') for ks in keyspaces if not is_system_keyspace(ks)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do it also in nemesis.py
in line 2922, could be removed from there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably will cause failure for case in line nemesis.py:4153
: need to add cql_quote_if_needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we shouldn't add cql_quote_if_needed
for sdcm.cluster.BaseNode.get_cfstats
- requires verification which form fits it
94a328d
to
6ecb2cf
Compare
6ecb2cf
to
3fa2c75
Compare
If always dropping quotes, please go again through all usages of |
2b8ba10
to
149e557
Compare
When keyspace names start with a digit, they are returned with surrounding double quotes. This can lead to double quoting in CQL statements that can lead to SCT failure. This commit updates the get_test_keyspaces func to strip these extra quotes. If keyspace isnt quoted the change is harmless
149e557
to
58b7e7d
Compare
@soyacz , could you please check again? there are few places in nemesis.py without usage cql_unquote_if_needed |
When keyspace names start with a digit, they are returned with surrounding double quotes. This can lead to double quoting in CQL statements that can lead to SCT failure. This commit updates the get_test_keyspaces func to strip these extra quotes. If keyspace isnt quoted the change is harmless
refer: https://argus.scylladb.com/tests/scylla-cluster-tests/553b0e31-6b23-4f9b-9953-05fde9c09791
Testing
https://jenkins.scylladb.com/view/staging/job/scylla-staging/job/eugene_test_folder/job/qutes/
PR pre-checks (self review)
backport
labelsReminders
sdcm/sct_config.py
)unit-test/
folder)