-
Notifications
You must be signed in to change notification settings - Fork 26
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
cqlsh: try server-side DESCRIBE, then client-side #88
Conversation
3a0f12b
to
7c9e942
Compare
One nit: "Fix tests" commit should be a part of the last commit - either @sylwiaszunejko should squash it or a scylla-cqlsh maintainer should merge it with squashing. |
@fruch There are some dtests that use cqlsh to run DESCRIBE. Do we need to run them to see which dtests need fixing before this is merged? |
cc: @Jadw1 - please review as well |
Yes we, otherwise we won't pass gating and won't be able to pass this change into scylla core And we should be aware of those small differences in output, some of them might need fixes to the core, and might break tools/users |
Are those dtests using cqlsh or |
They are using cqlsh, no one wrote dtest for server side describe |
@fruch How can I change |
You need to change the submodule in scylla core, and build the scylla unified package, then you can use that in dtest. |
7c9e942
to
3deeacc
Compare
3deeacc
to
3fa2fdd
Compare
I have run the dtests and there are 9 tests failing with my changes:
I will now try to fix it. |
if you are fixing the dtest, I would suggest doing it in a way it would work for both (so we can merge before, and not force us to merge it at the same time) |
01dd212
to
fdf3096
Compare
Since Scylla 5.2 (scylladb/scylladb@e6ffc22) a support for server-side DESCRIBE was added. However, cqlsh did not start to use this functionality, since it is only enabled if it detects CQL version at least 4. Scylla did not increase this version number as it doesn't support all of its features, so there is a need for a different detection mechanism for server-side DESCRIBE. This commit changes the behavior in do_describe: cqlsh will first try to execute the server-side DESCRIBE. If this fails with SyntaxException, meaning that Scylla doesn't support that command, cqlsh falls back to the client-side DESCRIBE behavior. The other possible solutions were rejected: - Based on Scylla version: would require ugly hard-coding of versions - Modifying Scylla to provide some indication that this feature is enabled: Scylla 5.2 is already released without it, by implementing it in another way, we'll get it out sooner - Do a trial "DESCRIBE" at the start of connection to detect if the server supports it: if cqlsh ever supported connecting to multiple nodes (right now it uses WhiteListRoundRobinPolicy) we would have to do the check on all of the nodes in case a rolling upgrade is currently occurring and some of the nodes don't support server-side DESCRIBE. The change was tested manually on a couple of last Scylla OSS, Scylla Enterprise and Cassandra releases. Fixes scylladb#17
fdf3096
to
b3604ad
Compare
The PR with changes to the dtests is now merged https://github.com/scylladb/scylla-dtest/pull/4319 and I did some refactoring of the tests here to make it work for different formatting versions. |
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.
LGTM
Since Scylla 5.2 (scylladb/scylladb@e6ffc22) a support for server-side DESCRIBE was added. However, cqlsh did not start to use this functionality, since it is only enabled if it detects CQL version at least 4. Scylla did not increase this version number as it doesn't support all of its features, so there is a need for a different detection mechanism for server-side DESCRIBE.
This PR changes the behavior in do_describe: cqlsh will first try to execute the server-side DESCRIBE. If this fails with SyntaxException, meaning that Scylla doesn't support that command, cqlsh falls back to the client-side DESCRIBE behavior. Also I fixed tests to be in line with recent changes to output sent by Scylla.
The other possible solutions were rejected:
The change was tested manually on a couple of last Scylla OSS.
Fixes #17