Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cqlsh: try server-side DESCRIBE, then client-side
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 #17
- Loading branch information