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

Call awaitReplication when checking node oplogs in magic_restore_test.js

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Replication
    • Fully Compatible
    • v8.0
    • Repl 2025-03-03
    • 0

      In the function assertOplogCountForNamespace, we perform a find on the oplog and check that the expected number of entries exist. This function is usually called on both primary and secondary nodes.

      On a slow machine, the find result on the secondary may be missing some entries. This is because while the secondary needs to durably write the oplog entries down before we ack a majority write, it may not have applied them yet, due to the oplog writing project. We currently can't read past the lastApplied, so even if the documents exist on the secondary oplog, it won't be returned in a find query.

      We should call awaitReplication so that the secondary's last applied is equal to the primary's before we read the oplog.

            Assignee:
            ali.mir@mongodb.com Ali Mir
            Reporter:
            ali.mir@mongodb.com Ali Mir
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: