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.


    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: None
    • Fix versions: 2.1.10, 3.0.1
    • Components: None
    • Labels:
    • Sprint:
      Java P2.1.x


      {"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:


      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.


          Issue links



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


                • Created: