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

Fix schema aggreement race conditions in in-JVM dtests

    XMLWordPrintableJSON

    Details

      Description

      There there are two race conditions in in-JVM dtest schema agreement, which are causing test failures:

      1. First is caused by the fact we’re starting waiting for schema propagation already after the schema agreement was reached (which was resulting into us endlessly waiting for an agreement that has already been established);
      2. The other one was because the callback to notify about successful agreement can be triggered already after the other node has notified about it, and control flow might have moved cluster to a different configuration.

      Example of exception:

      Caused by: java.lang.IllegalStateException: Schema agreement not reached
      	at org.apache.cassandra.distributed.impl.AbstractCluster$ChangeMonitor.waitForCompletion(AbstractCluster.java:?)
      	at org.apache.cassandra.distributed.impl.AbstractCluster.lambda$schemaChange$5(AbstractCluster.java:?)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:?)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:?)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:?)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:?)
      	at org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:?)
      	at java.lang.Thread.run(Thread.java:?)
      

        Attachments

          Activity

            People

            • Assignee:
              ifesdjeen Alex Petrov
              Reporter:
              ifesdjeen Alex Petrov
              Authors:
              Alex Petrov
              Reviewers:
              Caleb Rackliffe, David Capwell, Marcus Eriksson
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: