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

Mongorestore should handle duplicate key errors during oplog replay

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.6.4
    • 100.4.0
    • mongorestore
    • 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

              tim.fogarty@mongodb.com Tim Fogarty
              amol Alessandro Molina
              Evgeni Dobranov, Huan Li, Ryan Chipman
              Votes:
              2 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: