diff options
author | Alex Taskov <alex.taskov@mongodb.com> | 2019-09-24 18:26:26 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-09-24 18:26:26 +0000 |
commit | 108425fdd063a0c7dae50b2d48d3dadea35a0557 (patch) | |
tree | 5c70e50c4b6da382e3f980d2a2a3e0dfc0a79755 /src/mongo/shell | |
parent | d4c306ea210d905578c2cf464a117815d6ea83b9 (diff) | |
download | mongo-108425fdd063a0c7dae50b2d48d3dadea35a0557.tar.gz |
SERVER-42866 Trigger a logical session cache refresh on all shards in the ShardedCluster test fixture before running test
Diffstat (limited to 'src/mongo/shell')
-rw-r--r-- | src/mongo/shell/shardingtest.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js index 6a855c4b8b6..1b1fc300c21 100644 --- a/src/mongo/shell/shardingtest.js +++ b/src/mongo/shell/shardingtest.js @@ -1626,6 +1626,15 @@ var ShardingTest = function(params) { lastStableBinVersion, MongoRunner.getBinVersionFor(otherParams.configOptions.binVersion)))) { this.configRS.getPrimary().getDB("admin").runCommand({refreshLogicalSessionCacheNow: 1}); + + for (let i = 0; i < numShards; i++) { + if (otherParams.rs || otherParams["rs" + i] || startShardsAsRS) { + const rs = this._rs[i].test; + rs.getPrimary().getDB("admin").runCommand({_flushRoutingTableCacheUpdatesCmd: 1}); + } else { + this["shard" + i].getDB("admin").runCommand({_flushRoutingTableCacheUpdatesCmd: 1}); + } + } } }; |