summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamy Lanka <samy.lanka@gmail.com>2018-07-24 13:58:03 -0400
committerSamy Lanka <samy.lanka@gmail.com>2018-08-13 16:34:21 -0400
commit56856d277eca36dd36e029fee71459318b181e41 (patch)
tree743a1ee9b708f4ed071e168f1e8c798ecf4c5b68
parente10f27c411b48e3036dc22295db4fdc718eadfb1 (diff)
downloadmongo-56856d277eca36dd36e029fee71459318b181e41.tar.gz
SERVER-35246 Ignore NamespaceNotFound errors when running collMod during checkReplicaSet in replsettest.js
(cherry picked from commit 192b1e24ec53a011656a2063e4c5e70817b63d36)
-rw-r--r--src/mongo/shell/replsettest.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js
index 4ffdf4451fe..51a528030f4 100644
--- a/src/mongo/shell/replsettest.js
+++ b/src/mongo/shell/replsettest.js
@@ -1322,10 +1322,19 @@ var ReplSetTest = function(opts) {
// doing any I/O to avoid any overhead from allocating or deleting data
// files when using the MMAPv1 storage engine. We call awaitReplication()
// later on to ensure the collMod is replicated to all nodes.
- assert.commandWorked(dbHandle.runCommand({
- collMod: collInfo.name,
- usePowerOf2Sizes: true,
- }));
+ try {
+ assert.commandWorked(dbHandle.runCommand({
+ collMod: collInfo.name,
+ usePowerOf2Sizes: true,
+ }));
+ } catch (e) {
+ // Ignore NamespaceNotFound errors because a background thread could
+ // have dropped the collection after getCollectionInfos but before
+ // running collMod.
+ if (e.code != ErrorCodes.NamespaceNotFound) {
+ throw e;
+ }
+ }
}
});
}