Uploaded image for project: 'MongoDB Command Line Tools'
  1. MongoDB Command Line Tools
  2. TOOLS-2041

Mongorestore should handle duplicate key errors during oplog replay

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: 3.6.4
    • Fix Version/s: None
    • Component/s: mongorestore
    • Labels:
      None

      Description

      We made a dump with ``–oplog`` from a properly working system, but when restoring it we constantly faced `E11000 duplicate key` errors.

      The duplicate key obviously doesn't exist on the dumped database as it has an unique index, but as the dump takes hours to complete, it looks like that data that was deleted ends up being into the dump and data that was created after delation while the dump is running ends up being there too.

      This is the kind of situation that ``–oplogReplay`` should address, but it looks like the oplog is replayed after the indexes were recreated and thus the restore fails while recreating the indexes as it faces a state where duplicate data is present.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                backlog-server-tools Backlog - Server Tools Team
                Reporter:
                amol Alessandro Molina
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: