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

Mongorestore should handle duplicate key errors during oplog replay

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 100.4.0
    • Affects Version/s: 3.6.4
    • Component/s: mongorestore
    • Labels:

      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.

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