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

Ensure writes have completed after dropping a table, before recycling commit log segments (CASSANDRA-7437)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.1.0
    • None
    • Low

    Description

      I've noticed on unit test output that there are still assertions being raised here, so I've taken a torch to the code path to make damned certain it cannot happen in future

      1. We now wait for all running reads on a column family or writes on the keyspace during a dropCf call
      2. We wait for all appends to the prior commit log segments before recycling them
      3. We pass the list of dropped Cfs into the CL.forceRecycle call so that they can be markedClean definitely after they have been marked finished
      4. Finally, to prevent any possibility of this still happening causing any negative consequences, I've suppressed the assertion in favour of an error log message, as the assertion would break correct program flow for the drop and potentially result in undefined behaviour

      (in actuality there is the slightest possibility still of a race condition on read of a secondary index that causes a repair driven write, but this is a really tiny race window, as I force wait for all reads after unlinking the CF, so it would have to be a read that grabbed the CFS reference before it was dropped, but hadn't quite started its read op yet). In fact this is also safe, as these modifications all grab a write op from the Keyspace, which has to happen before they get the CFS, and also because we drop the data before waiting for reads to finish on the CFS.

      Attachments

        1. 7437_test.py
          1 kB
          Philip Thompson
        2. 7437.log
          377 kB
          Philip Thompson
        3. 7437.round2.txt
          4 kB
          Benedict Elliott Smith

        Activity

          People

            benedict Benedict Elliott Smith
            benedict Benedict Elliott Smith
            Benedict Elliott Smith
            T Jake Luciani
            Philip Thompson Philip Thompson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: