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

Initial Sync and Shutdown write to the minValid document at the lastApplied

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.3
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
    • Fully Compatible
    • ALL
    • Repl 2019-11-18, Execution Team 2019-12-16, Repl 2019-12-02, Repl 2019-12-16, Execution Team 2020-01-13, Execution Team 2020-01-27, Execution Team 2019-12-30
    • 9

      During shutdown and initial sync, we update the minValid document using the lastApplied as the timestamp of the write. Since the lastApplied has already been updated before we write to the minValid document, any reader can read at the lastApplied before the write commits.

      This causes us to hit at WT invariant: commitTimestamp > latest active read timestamp (Note, the commitTimestamp is referring to the timestamp at which the write to the minValid document commits).

      Initial Sync: We get the lastApplied from the repl coordinator here and update the minValid here using the lastApplied.

      Shutdown: We get the lastApplied from the repl coordinator and update the minValid here.

      This race doesn't seem to affect steady state replication as frequently. This is because sync tail ensures that the lastApplied does not change at the start of the batch and bgsync does not set the lastApplied unless it is unset.

      UPDATE: The WT invariant was disabled. Enabling the WT invariant is blocked on this ticket.

            suganthi.mani@mongodb.com Suganthi Mani
            pavithra.vetriselvan@mongodb.com Pavithra Vetriselvan
            0 Vote for this issue
            14 Start watching this issue