Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-51903

Avoid VectorClockPersistCommand deadlock upon fast replica state transitions

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • Sharding 2020-11-02, Sharding 2020-11-16, Sharding 2020-11-30
    • 16

    Description

      When the vector clock needs to be persisted by a secondary, waitForDurable ends up calling _vectorClockPersist on the primary and blocks waiting for the reply. However, if the same node steps up right before performing the call, there will be a deadlock because waitForDurable will wait on its own reply.

      Thanks to the timeout, the system doesn't hang forever but the vector clock is not persisted and casual consistency is therefore not ensured.

      Moreover, VectorClockPersistCommand::supportsWriteConcern is currently true, meaning that the command is required to be invoked with a write concern field, however it should be set to false because:
      1) It is not necessary, because the VectorClockDocument is always written with majority write concern.
      2) It is wrong, because the command fails on this uassert since requests are always received from internal clients (always from secondaries).

      Attachments

        Activity

          People

            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: