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

Move CQL3 consistency to protocol

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 1.2.0 beta 2
    • Component/s: Legacy/CQL
    • Labels:
      None

      Description

      Currently, in CQL3, you set the consistency level of an operation in
      the language, eg 'SELECT * FROM foo USING CONSISTENCY QUORUM'. It now
      looks like this was a mistake, and that consistency should be set at
      the protocol level, i.e. as a separate parameter along with the query.

      The reasoning is that the CL applies to the guarantee provided by the
      operation being successful, not to the query itself. Specifically,
      having the CL being part of the language means that CL is opaque to
      low level client libraries without themselves parsing the CQL, which
      we want to avoid. Thus,

      • Those libraries can't implement automatic retries policy, where a query would be retried with a smaller CL. (I'm aware that this is often a Bad Idea, but it does have legitimate uses and not having that available is seen as a regression from the Thrift api.)
      • We had to introduce CASSANDRA-4448 to allow the client to configure some form of default CL since the library can't handle that anymore, which is hackish.
      • Executing prepared statements with different CL requires preparing multiple statements.
      • CL only makes sense for BATCH operations as a whole, not the sub-statements within the batch. Currently CQL3 "fixes" that by validating the given CLs match, but it would be much more clear if the CL was on the protocol side.

        Attachments

        1. 0001-Move-consistency-level-to-the-protocol-level.txt
          64 kB
          Sylvain Lebresne
        2. 0001-Move-consistency-level-to-the-protocol-level-2.txt
          61 kB
          Sylvain Lebresne
        3. 0001-Move-consistency-level-to-the-protocol-level-3.txt
          60 kB
          Sylvain Lebresne
        4. 0002-Remove-remains-of-4448.txt
          8 kB
          Sylvain Lebresne
        5. 0002-Remove-remains-of-4448-3.txt
          8 kB
          Sylvain Lebresne
        6. 0002-Thrift-generated-file-diffs-2.txt
          160 kB
          Sylvain Lebresne
        7. 0003-Thrift-generated-file-diffs.txt
          160 kB
          Sylvain Lebresne
        8. 0003-Thrift-generated-file-diffs-3.txt
          160 kB
          Sylvain Lebresne

          Activity

            People

            • Assignee:
              slebresne Sylvain Lebresne
              Reporter:
              jbellis Jonathan Ellis
              Authors:
              Sylvain Lebresne
              Reviewers:
              Jonathan Ellis
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: