summaryrefslogtreecommitdiff
path: root/jstests/sharding/list_indexes_shard_targeting.js
diff options
context:
space:
mode:
authorMarcos José Grillo Ramírez <marcos.grillo@mongodb.com>2020-07-09 18:23:22 +0200
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-17 11:43:50 +0000
commit5ed7de1446262088dfa8ea420a7d9af4d92ceed7 (patch)
tree6443e7cbc3e4674ab7dc25221317024921407f31 /jstests/sharding/list_indexes_shard_targeting.js
parent8d6112714189fdb6c652ad06a9496c5ade6c0cdc (diff)
downloadmongo-5ed7de1446262088dfa8ea420a7d9af4d92ceed7.tar.gz
SERVER-49311 Prevent the PeriodicShardedIndexConsistencyChecker cause failures on tests that require no metadata refresh to be performed until needed
Diffstat (limited to 'jstests/sharding/list_indexes_shard_targeting.js')
-rw-r--r--jstests/sharding/list_indexes_shard_targeting.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/jstests/sharding/list_indexes_shard_targeting.js b/jstests/sharding/list_indexes_shard_targeting.js
index 6914d8694d1..a5cd09efdf9 100644
--- a/jstests/sharding/list_indexes_shard_targeting.js
+++ b/jstests/sharding/list_indexes_shard_targeting.js
@@ -12,16 +12,17 @@ load("jstests/libs/fail_point_util.js");
// This test makes shards have inconsistent indexes.
TestData.skipCheckingIndexesConsistentAcrossCluster = true;
-const st = new ShardingTest({shards: 3});
+// Disable checking for index consistency to ensure that the config server doesn't trigger a
+// StaleShardVersion exception on shards and cause them to refresh their sharding metadata.
+const nodeOptions = {
+ setParameter: {enableShardedIndexConsistencyCheck: false}
+};
+
+const st = new ShardingTest({shards: 3, other: {configOptions: nodeOptions}});
const dbName = "test";
const collName = "user";
const ns = dbName + "." + collName;
-// Disable checking for index consistency to ensure that the config server doesn't trigger a
-// StaleShardVersion exception on shards and cause them to refresh their sharding metadata.
-st._configServers.forEach(
- config => config.adminCommand({setParameter: 1, enableShardedIndexConsistencyCheck: false}));
-
assert.commandWorked(st.s.adminCommand({enableSharding: dbName}));
st.ensurePrimaryShard(dbName, st.shard0.shardName);