Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-16508

Running cqlsh against cassandra 3 throws error about beta flag not set

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 4.0-rc1, 4.0
    • Component/s: CQL/Interpreter
    • Labels:
      None
    • Bug Category:
      Correctness
    • Severity:
      Normal
    • Complexity:
      Low Hanging Fruit
    • Discovered By:
      User Report
    • Platform:
      All
    • Impacts:
      None
    • Since Version:
    • Test and Documentation Plan:
      Hide

      Manually tested locally major version back through Cassandra version 2.1, ran all cqlsh and python dtests.

      Show
      Manually tested locally major version back through Cassandra version 2.1, ran all cqlsh and python dtests.

      Description

      I just ran `cqlsh` from `trunk` commit 2aa22ba99dcc1dacb07b7af31b2664e7db839063 against a Cassandra 3.11.10 docker image.

      I expected that the newer cqlsh would down-negotiate from the v5 protocol to the older v4 protocol.

      Instead, I was surprised to get a server error about a beta protocol being used without `BETA_FLAG` being set. I unfortunately had to reboot my computer, so I lost the traceback but I can easily reproduce if needed.

      I think what's happening is that this commit promoted v5 out of beta:
      https://github.com/apache/cassandra/commit/c9d6c725dd0b4aa5693eb1c6d2221c28e9e99c6e#diff-9e4fe0cfd28004625a8006be8a0bdeab8cbdfb039449fb9501b15e8952577aaaL479

      And then when it tries to contact the older cassandra version, the server complains that it received a request using the v5 protocol without this beta flag being set.

      However, I was expecting that cqlsh would catch the error and down-negotiate to v4. Instead, it simply returns the error with no message about how to solve. As someone relatively new to `cqlsh`, I assumed at first there was no workaround except for downgrading my version of `cqlsh`. After some googling, I stumbled across a stackoverflow pointing toward the `--cqlversion` flag.

      Given that this was the first cqlsh to support python 3, it means that anyone trying to use python 3 for cqlsh against cassandra 3.x will hit this weird error. There is no alternative if you want to use python 3.

      My suggested fix is to catch the error and either prompt the user with something like Perhaps you want to manually specify a different cql protocol version using the `--cqlversion` flag? or simply auto-down negotiate to version 4 (although I understand why auto-down-negotiating may not be the right move).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                aholmber Adam Holmberg
                Reporter:
                jeffwidman Jeff Widman
                Authors:
                Adam Holmberg
                Reviewers:
                Michael Semb Wever
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: