Uploaded image for project: 'DataStax Java Driver for Apache Cassandra'
  1. JAVA-764

JAVA-764: Retry with the normal consistency level (not the serial one) when a write times out on the Paxos phase.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.10, 3.0.1
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Java P2.1.x

      Description

      {"log":"Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: SERIAL is not supported as conditional update commit consistency. Use ANY if you mean \"make sure it is accepted but I don't care how many replicas commit it for non-SERIAL reads\"\n","stream":"stderr","time":"2015-04-14T13:32:27.625293689Z"}
      
      • When a write timeout occurs, the Java driver can be configured to call a RetryPolicy to allow clients flexibility in error handling.
      • The onWriteTimeout method is passed a single ConsistencyLevel argument, described as "the original consistency level of the write that timed out." This looks a bit sketchy since writes can set two kinds of consistency levels (CL and SCL), but the retry handler only gets informed about one.
      • When a write timeout occurs on a SCL=SERIAL write, the consistency level passed to onWriteTimeout is SERIAL. Retrying with the level given results in an InvalidQueryException.

      The bug is reproduced in this simple java program:

      https://github.com/Datomic/CassandraCAS


      Resolution:
      When a write times out on the Paxos phase, retry with the consistency level of the previous attempt (not the serial CL).
      Updated the built-in policies.
      Added ConsistencyLevel.isSerial ( JAVA-982 Resolved )
      Changed the code so that a retry with CL=null uses the CL of the last attempt, not the original one (in case a downgrading policy retries multiple times).
      Clarified javadocs.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                alexandre.dutra Alexandre Dutra
                Reporter:
                sebastian.estevez@datastax.com Sebastian Estevez
              • Votes:
                2 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: