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

Deadlock in CDC during segment flush

    XMLWordPrintableJSON

Details

    • Critical

    Description

      In the patch for CASSANDRA-8844, we added a synchronized(this) block inside CommitLogSegment.setCDCState. This introduces the possibility of deadlock in the following scenario:

      1. A CommitLogSegment.sync() call is made (synchronized method)
      2. A CommitLogSegment.allocate call from a cdc-enabled write is in flight and acquires a reference to the Group on appendOrder (the OpOrder in the Segment)
      3. CommmitLogSegment.sync hits waitForModifications which calls appendOrder.awaitNewBarrier
      4. The in-flight write, if changing the state of the segment from CDCState.PERMITTED to CDCState.CONTAINS, enters setCDCState and blocks on synchronized(this)

      And neither of them ever come back. This came up while doing some further work on CASSANDRA-12148.

      Attachments

        Activity

          People

            JoshuaMcKenzie Joshua McKenzie
            JoshuaMcKenzie Joshua McKenzie
            Joshua McKenzie
            Carl Yeksigian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: