LastOpFixer can set Client optime backwards in sessions

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Gone away
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Replication
    • ALL
    • 45
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In write_ops_exec.cpp, there is a class called LastOpsFixer, which sets the client's optime to the system time in the case of a failed or no-op write (e.g. a $set of a field to the value it is already set to).

      As long as LastOpsFixer runs outside any WriteUnitOfWork (the normal case), this is fine. However, with sessions we can have a long-lived outer WUOW. In this case, if we have multiple operations, one of them can succeed and one can be a no-op. The successful operation will set the client optime to its optime on WUOW commit. The no-op will set the client optime to the system optime immediately.

      If other operations happen in between the successful operation and the no-op, advancing the system optime, this results in the commit setting the client optime backwards (and hitting an invariant).

      This currently happens only when writing in a snapshot read.

            Assignee:
            [DO NOT USE] Backlog - Replication Team
            Reporter:
            Matthew Russotto (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: