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

Operations.migrateReadRequiredOperations fails due to concurrent access when TransactionStatement is prepared

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 5.0-alpha1, 5.0
    • Accord
    • None

    Description

      java.util.NoSuchElementException
      	at java.base/java.util.ArrayList$Itr.next(ArrayList.java:1000)
      	at org.apache.cassandra.cql3.Operations.migrateReadRequiredOperations(Operations.java:71)
      	at org.apache.cassandra.cql3.Operations.migrateReadRequiredOperations(Operations.java:63)
      	at org.apache.cassandra.cql3.statements.ModificationStatement.getTxnWriteFragment(ModificationStatement.java:828)
      	at org.apache.cassandra.cql3.statements.TransactionStatement.createWriteFragments(TransactionStatement.java:290)
      	at org.apache.cassandra.cql3.statements.TransactionStatement.createUpdate(TransactionStatement.java:309)
      	at org.apache.cassandra.cql3.statements.TransactionStatement.createTxn(TransactionStatement.java:334)
      	at org.apache.cassandra.cql3.statements.TransactionStatement.execute(TransactionStatement.java:375)
      

      this was caused by having shared mutable state! when we start creating the txn objects we would also mutate the mutations that had operations that need to be run in the txn, this has an issue when the txn is run from prepared statements as the object is shared by multiple threads, causing the array to be mutated while iterating.

      Attachments

        Activity

          People

            dcapwell David Capwell
            dcapwell David Capwell
            David Capwell
            Ariel Weisberg, Caleb Rackliffe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 10m
                1h 10m