scylladb / scylla-cqlsh

A fork of the cqlsh code
Apache License 2.0
16 stars 32 forks source link

Show Scylla version on cqlsh startup #9

Closed nyh closed 2 years ago

nyh commented 2 years ago

This issue has been raised in the Scylla repository multiple times, see https://github.com/scylladb/scylladb/issues/680 and https://github.com/scylladb/scylladb/issues/5119.

Cqlsh currently shows a message like this when it starts up:

Connected to  at 127.0.0.1:9042
[cqlsh 6.0.0 | Cassandra 3.0.8 | CQL spec 3.3.1 | Native protocol v4]
Use HELP for help.

A show version command shows a similar string:

cqlsh> show version
[cqlsh 6.0.0 | Cassandra 3.0.8 | CQL spec 3.3.1 | Native protocol v4]

This can confuse Scylla users (who don't understand why it tells them this is Cassandra), and we're loosing a convenient way for database administrators to figure out which version of Scylla they are using by connecting to it with cqlsh.

The word "Cassandra" is hard-coded into cqlsh, and the version number "3.0.8" comes from Scylla and we can't change it to an arbitrary number without confusing CQL drivers (not just cqlsh) as explained in https://github.com/scylladb/scylladb/issues/680.

Therefore the proposal in the above issues is that we should modify our own fork of cqlsh to add a request that figures out if the server is Scylla, and if it is, exactly which version - and if it is Scylla, display that information instead of the "Cassandra 3.0.8" message.

After we have such a patch, we can try to upstream it, but let's start with having it in our own fork first.

fruch commented 2 years ago

@nyh does scylla advertise it's version in any CQL table ?

fruch commented 2 years ago

@nyh does scylla advertise it's version in any CQL table ?

yeah looks like it does...

cqlsh> SELECT version FROM system.versions WHERE key='local' ;

 version
-----------------------------------
 5.2.0~dev-0.20221130.8bc0af9e34fa

if we'll have a systeam.scylla_local, we could show scylla details.

nyh commented 2 years ago

Isn't this system.versions our own invention and can be used to tell Scylla and Cassandra apart (in addition to giving Scylla's version)?