-
Type: Bug
-
Resolution: Done
-
Priority: 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.
- has to be done after
-
TOOLS-110 mongorestore crashes if it fails to restore an index
- Closed