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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.1.10
    • Replication
    • None
    • Fully Compatible
    • ALL
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: