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

Replaying materialized view updates from commitlog after node decommission crashes Cassandra



    • Critical


      This issue is reproducible through a Jepsen test, runnable as

      lein with-profile +trunk test :only cassandra.mv-test/mv-crash-subset-decommission

      This test crashes/restarts nodes while decommissioning nodes. These actions are not coordinated.

      In 10164, we introduced a change to re-apply materialized view updates on commitlog replay.

      Some nodes, upon restart, will crash in commitlog replay. They throw the "Trying to get the view natural endpoint on a non-data replica" runtime exception in getViewNaturalEndpoint. I added logging to getViewNaturalEndpoint to show the results of replicationStrategy.getNaturalEndpoints for the baseToken and viewToken.

      It can be seen that these problems occur when the baseEndpoints and viewEndpoints are identical but do not contain the broadcast address of the local node.

      For example, a node at crashes on replay of a write whose base token and view token replicas are both [,,]. It seems we try to guard against this by considering pendingEndpoints for the viewToken, but this does not appear to be sufficient.

      I've attached the system.logs for a test run with added logging. In the attached logs, n1 is at, n2 is at, and so on. is the decommissioned node.


        1. n5.log
          268 kB
          Joel Knighton
        2. n4.log
          799 kB
          Joel Knighton
        3. n3.log
          670 kB
          Joel Knighton
        4. n2.log
          664 kB
          Joel Knighton
        5. n1.log
          1.15 MB
          Joel Knighton



            jkni Joel Knighton
            jkni Joel Knighton
            Joel Knighton
            T Jake Luciani
            0 Vote for this issue
            4 Start watching this issue