0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-34755 ignore missing collections when shutting down backup_restore.js

This commit is contained in:
Eric Milkie 2018-05-01 09:39:32 -04:00
parent e8fe32029a
commit d58ec924d3

View File

@ -201,6 +201,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();
@ -309,16 +313,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');
@ -328,16 +326,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)));