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

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

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.10
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Repl 2019-02-25, Repl 2019-03-11, Repl 2019-03-25

      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.

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

              Created:
              Updated:
              Resolved: