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

mongorestore does not return failure when disk full

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: Legacy C++ Implementation
    • Component/s: mongorestore
    • None

      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.

            Assignee:
            backlog-server-platform DO NOT USE - Backlog - Platform Team
            Reporter:
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: