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

mongorestore should retry insert commands in the face of network errors

    • Type: Icon: Task Task
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: mongorestore

      mongorestore accepts a replica set connection string for its --host argument. However, it only uses that connection string as a way to discover the current primary at the time of starting the restore. If a primary failover occurs during the restore, then mongorestore just logs a bunch of "error: EOF" and doesn't retry inserting the documents. Since the writes are being performed with w="majority" by default in a replica set, it should be possible to have mongorestore automatically retry the insert commands on network errors, "not master" errors, etc., and to ignore any resulting DuplicateKey error responses the server may return.

      The current behavior of mongorestore has made it painful for me to migrate 1TB of data over to a new Atlas cluster.

            Assignee:
            Unassigned Unassigned
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: