summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2018-05-01 09:39:32 -0400
committerEric Milkie <milkie@10gen.com>2018-10-30 01:52:18 -0400
commit73695b38fbd94fb3546e5ad8c22b80ff523a7af1 (patch)
tree0d97014785fbaddffe83b8ebd8963e03ab2ab0fb
parent98c2b9e9c05e18c3417dbfd882d7f32b81ec558e (diff)
downloadmongo-73695b38fbd94fb3546e5ad8c22b80ff523a7af1.tar.gz
SERVER-34755 ignore missing collections when shutting down backup_restore.js
(cherry picked from commit d58ec924d3dcbac14c4e62d1890352a65bf1836b)
-rw-r--r--jstests/noPassthrough/libs/backup_restore.js17
1 files changed, 4 insertions, 13 deletions
diff --git a/jstests/noPassthrough/libs/backup_restore.js b/jstests/noPassthrough/libs/backup_restore.js
index 7eb5cd000ac..8acec46f193 100644
--- a/jstests/noPassthrough/libs/backup_restore.js
+++ b/jstests/noPassthrough/libs/backup_restore.js
@@ -202,6 +202,10 @@ var BackupRestoreTest = function(options) {
jsTestLog("Backup restore " + tojson(options));
+ // skipValidationOnNamespaceNotFound must be set to true for correct operation of this test.
+ assert(typeof TestData.skipValidationOnNamespaceNotFound === 'undefined' ||
+ TestData.skipValidationOnNamespaceNotFound);
+
// Test options
// Test name
var testName = jsTest.name();
@@ -305,16 +309,10 @@ var BackupRestoreTest = function(options) {
_runCmd(rsyncCmd);
sleep(10000);
}
- // Set an option to skip 'ns not found' error during collection validation
- // when shutting down mongod.
- TestData.skipValidationOnNamespaceNotFound = true;
// Stop the mongod process
rst.stop(secondary.nodeId);
- // Unset to allow future collection validation on stopMongod.
- TestData.skipValidationOnNamespaceNotFound = false;
-
// One final rsync
_runCmd(rsyncCmd);
removeFile(hiddenDbpath + '/mongod.lock');
@@ -324,16 +322,9 @@ var BackupRestoreTest = function(options) {
assert.gt(copiedFiles.length, 0, testName + ' no files copied');
rst.start(secondary.nodeId, {}, true);
} else if (options.backup == 'stopStart') {
- // Set an option to skip 'ns not found' error during collection validation
- // when shutting down mongod.
- TestData.skipValidationOnNamespaceNotFound = true;
-
// Stop the mongod process
rst.stop(secondary.nodeId);
- // Unset to allow future collection validation on stopMongod.
- TestData.skipValidationOnNamespaceNotFound = false;
-
copyDbpath(dbpathSecondary, hiddenDbpath);
removeFile(hiddenDbpath + '/mongod.lock');
print("Source directory:", tojson(ls(dbpathSecondary)));