diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2021-10-06 14:47:05 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-10-06 16:04:32 +0000 |
commit | c68c1abec328179d362deedd12aafba79fd4392e (patch) | |
tree | 1a3090f8e9a720180772d26042537fc8c2fd2089 | |
parent | 042f23a84bdbe5b937f63903c6c8c0239ac0385e (diff) | |
download | mongo-c68c1abec328179d362deedd12aafba79fd4392e.tar.gz |
SERVER-60486 Update assumptions made in remove_invalid_index_options.js
(cherry picked from commit 35d5a6fc01fbe994873024c4f44d0bc4da9d6a1e)
-rw-r--r-- | jstests/multiVersion/remove_invalid_index_options.js | 16 |
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); |