Uploaded image for project: 'MongoDB CLI Tools'
  1. MongoDB CLI Tools
  2. TOOLS-115

mongorestore does not return failure when disk full



    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Gone away
    • Affects Version/s: Legacy C++ Implementation
    • Fix Version/s: None
    • Component/s: mongorestore
    • Labels:


      When using mongorestore to restore data, if the volume runs out of space then obviously the restore will be incomplete, however mongorestore does not return failure (ie. the exit code is still 0). This is the case when using --dbpath and not, and also when using --w 1 to (try to) avoid fire-and-forget mode. The expected behaviour is that any error or problem which causes the restore to be incomplete should result in a non-zero exit code (so that this condition can be reliably detected and reported).

      SERVER-11710 complicates things a little. It means that when indexes are restored, the failure (due to disk space) causes mongorestore to abort() and return a non-zero error code (2.4 and 2.6 also dump core). Since there is always the _id index (at least), this currently means that a mongorestore which encounters a full disk will always return failure. However, once SERVER-11710 is fixed, this will no longer be the case. This can be checked by editing the .metadata.json files in the dump and removing all the indexes, to stop mongorestore from trying to restore them. In this case, the mongorestore returns success, even though the restore has not been successful.

      Not sure if this is related to SERVER-8893. That ticket doesn't mention --dbpath or --w 1 so it may be more a fire-and-forget problem.


          Issue Links



              • Assignee:
                backlog-server-platform Backlog - Platform Team
                kevin.pulo Kevin Pulo
              • Votes:
                0 Vote for this issue
                5 Start watching this issue


                • Created: