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

Retrying findAndModify can error if oplog write for was rolled back

    XMLWordPrintable

Details

    • ALL
    • v4.0, v3.6
    • Sharding 2018-08-13

    Description

      Retrying a findAndModify can error if its oplog write was rolled back but not the post/pre image oplog entry.

      For retryable findAndModify, the pre/post image is stored as a separate oplog entry with op type 'n'. This is written to the oplog before the actual update/remove oplog entry. If the secondaries were able to replicate up to the pre/post image but not the actual update/remove, it will be in an inconsistent state when it becomes the new primary at that point. Attempting to retry will fail because the server thinks that it has already executed the write, but cannot properly fetch the oplog entries because it expects both the pre/post image and update/remove oplog to exist.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-sharding Backlog - Sharding Team
              randolph@mongodb.com Randolph Tan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: