Hi all,

I was using the cqlsh from Cassandra 4.0 RC1 and trying to connect to a Cassandra 3.11 cluster, and it does not appear to be working correctly. Specificity, the "desc" command does not work at all.

Steps to reproduce:

       # ensure you have docker installed and running
       # run the following docker commands to create and start a
       Cassandra 3.11 container
       ~ $ docker create --name cassandra3 cassandra:3.11.10
       5d903e48e0661e39080198de5e8752356a5a666132211a500ea38af0fc2a0356
       ~ $ docker start cassandra3
       cassandra3
       ~ $ docker exec -ti cassandra3 bash

       # inside the docker container, try the default cqlsh version
       root@5d903e48e066:/# cqlsh
       Connected to Test Cluster at 127.0.0.1:9042.
       [cqlsh 5.0.1 | Cassandra 3.11.10 | CQL spec 3.4.4 | Native
       protocol v4]
       Use HELP for help.
       cqlsh> desc keyspaces;

       system_traces  system_schema  system_auth  system system_distributed

       cqlsh> use system_auth;
       cqlsh:system_auth> desc tables;

       resource_role_permissons_index  role_permissions role_members  roles

       cqlsh:system_auth> select * from roles;

         role      | can_login | is_superuser | member_of | salted_hash
       
-----------+-----------+--------------+-----------+--------------------------------------------------------------
         cassandra |      True |         True |      null |
       $2a$10$8UNyioBF41/OZfcCa2aqXOHvXiNXArBHKaUUhMyPAFKpfN8byXonm

       (1 rows)
       cqlsh:system_auth> exit

       # obviously, everything worked as expected

       # now install git to clone the Cassandra 4.0 RC1 source code,
       and python3-six, which is a dependency of cqlsh
       root@5d903e48e066:/# apt-get update -qq && apt-get install -qq
       git python3-six
       ......

       # clone the Cassandra repository and checkout the
       cassandra-4.0-rc1 tag
       root@5d903e48e066:/# git clone -b cassandra-4.0-rc1 --depth 1
       https://github.com/apache/cassandra.git cassandra-4.0-rc1
       Cloning into 'cassandra-4.0-rc1'...
       ......

       # run the cqlsh from the Git repository, and repeat all the
       cqlsh statements above
       root@5d903e48e066:/# cd cassandra-4.0-rc1/bin
       root@5d903e48e066:/cassandra-4.0-rc1/bin# ./cqlsh
       Connected to Test Cluster at 127.0.0.1:9042
       [cqlsh 6.0.0 | Cassandra 3.11.10 | CQL spec 3.4.4 | Native
       protocol v4]
       Use HELP for help.
       cqlsh> desc keyspaces;

       cqlsh> use system_auth;
       cqlsh:system_auth> desc tables;

       cqlsh:system_auth> select * from roles;

         role      | can_login | is_superuser | member_of | salted_hash
       
-----------+-----------+--------------+-----------+--------------------------------------------------------------
         cassandra |      True |         True |      null |
       $2a$10$8UNyioBF41/OZfcCa2aqXOHvXiNXArBHKaUUhMyPAFKpfN8byXonm

       (1 rows)
       cqlsh:system_auth> exit
       root@5d903e48e066:/cassandra-4.0-rc1/bin#

       # "desc" did not work, but "use" and "select" worked


   My question is, are they suppose to be compatible? If so, this
   almost certainly is a bug. If not, I'd strongly recommend Cassandra
   to add a compatibility warning in the 4.0 version cqlsh when it's
   connected to a 3.x Cassandra server. Because I can foresee many
   users will run into this issue, especially when they are in the
   middle of upgrading from 3.x to 4.0.


   Regards,

   Bowen

Reply via email to