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

Speculative majority change stream update lookup on secondary may return pre-image

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.10
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Repl 2019-02-25, Repl 2019-03-11, Repl 2019-03-25

      Description

      Currently speculative majority change streams on secondary read from the local snapshot and then, after executing, wait for the most recent lastApplied optime to majority commit. For update lookup queries, reading at a local snapshot means that nothing prevents them from reading in the middle of secondary batch application, since majority read concern levels by default do not read from the current lastApplied timestamp. Since we write out oplog entries before we apply them on secondaries, this means that an update lookup query may return a document version earlier than its associated change event. To fix this, we should instead have speculative change stream oplog queries and update lookup queries both read from the lastApplied timestamp. After executing, they can wait for this read timestamp to majority commit. This will ensure that update lookup queries always read data at least as new as their associated change event.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              william.schultz William Schultz (Inactive)
              Reporter:
              william.schultz William Schultz (Inactive)
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: