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

waitUntilDurable call spanning rollback can set lastDurable ahead of journaling

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2020-10-19

      A waitUntilDurable call can span the lifetime of a rollback and cause us to set lastDurable ahead of journaling as follows:

      • lastApplied = OpTime(2,2), lastDurable = OpTime(1,1)
      • Asynchronous thread decides to set lastDurable to OpTime(2,2)
      • Rollback occurs. lastApplied = OpTime(1,1), lastDurable = OpTime(1,1)
      • Apply oplog entry. lastApplied = OpTime(1,2), lastDurable = OpTime(1,1)
      • Apply oplog entry. lastApplied = OpTime(3,3), lastDurable = OpTime(1,1)
      • Asynchronous thread succeeds in setting lastDurable to OpTime(2,2). This is not a time in the oplog. Additionally, this implies that OpTime(1,2) is journaled, which it is not.

      I don't think this can cause us to incorrectly respond to a client that a write is journaled or majority committed. However, it seems possible to violate internal invariants.

            Assignee:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: