summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2021-10-06 14:47:05 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-06 15:13:48 +0000
commit35d5a6fc01fbe994873024c4f44d0bc4da9d6a1e (patch)
treeb6ed53be352c9b45454953db9e0f754ee2e20876
parentde8b58214880e0b61d01fecb7e5d8b7abbdb8c27 (diff)
downloadmongo-35d5a6fc01fbe994873024c4f44d0bc4da9d6a1e.tar.gz
SERVER-60486 Update assumptions made in remove_invalid_index_options.js
-rw-r--r--jstests/multiVersion/remove_invalid_index_options.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/jstests/multiVersion/remove_invalid_index_options.js b/jstests/multiVersion/remove_invalid_index_options.js
index 00b70ca34d6..c49422423c4 100644
--- a/jstests/multiVersion/remove_invalid_index_options.js
+++ b/jstests/multiVersion/remove_invalid_index_options.js
@@ -42,16 +42,14 @@ assert.commandWorked(primaryColl.createIndex({z: 1}, {xyz: false}));
fpPrimary.off();
fpSecondary.off();
-// Verify that the primary (latest) detects invalid index options.
+// Verify that the primary (latest) and secondary (last-lts) detect invalid index options.
let validateRes = assert.commandWorked(primaryDB.runCommand({validate: collName}));
assert(!validateRes.valid);
-// Verify that the secondary (last-lts) does not detect invalid index options.
validateRes = assert.commandWorked(secondaryDB.runCommand({validate: collName}));
-assert(validateRes.valid);
+assert(!validateRes.valid);
-// Use collMod to remove the invalid index options in the collection. This has no effect on the
-// secondary node.
+// Use collMod to remove the invalid index options in the collection.
assert.commandWorked(primaryDB.runCommand({collMod: collName}));
// Removing unknown field from index spec.
@@ -59,12 +57,14 @@ checkLog.containsJson(primary, 23878, {fieldName: "safe"});
checkLog.containsJson(primary, 23878, {fieldName: "force"});
checkLog.containsJson(primary, 23878, {fieldName: "xyz"});
-// Verify that the index no longer has invalid index options on the primary.
+checkLog.containsJson(secondary, 23878, {fieldName: "safe"});
+checkLog.containsJson(secondary, 23878, {fieldName: "force"});
+checkLog.containsJson(secondary, 23878, {fieldName: "xyz"});
+
+// Verify that the index no longer has invalid index options.
validateRes = assert.commandWorked(primaryDB.runCommand({validate: collName}));
assert(validateRes.valid);
-// The secondary, which doesn't have the capability to detect invalid index options will return
-// successfully.
validateRes = assert.commandWorked(secondaryDB.runCommand({validate: collName}));
assert(validateRes.valid);