diff options
author | Alex Taskov <alex.taskov@mongodb.com> | 2019-10-22 01:03:23 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-22 01:03:23 +0000 |
commit | 16572981e9b361429b12f143b95415c33fb98751 (patch) | |
tree | 0f0e68a59ced63c56b8f8b94dd041d9a415cbf66 | |
parent | 84ac90293a3147f3b27240a7ab12de347f45a6a7 (diff) | |
download | mongo-16572981e9b361429b12f143b95415c33fb98751.tar.gz |
SERVER-42866 Trigger a logical session cache refresh on all shards in the ShardedCluster test fixture before running test
-rw-r--r-- | buildscripts/resmokelib/testing/fixtures/shardedcluster.py | 5 | ||||
-rw-r--r-- | src/mongo/shell/shardingtest.js | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py index 47bcde3dcfc..6efddedf8aa 100644 --- a/buildscripts/resmokelib/testing/fixtures/shardedcluster.py +++ b/buildscripts/resmokelib/testing/fixtures/shardedcluster.py @@ -135,6 +135,11 @@ class ShardedClusterFixture(interface.Fixture): primary.admin.command({ "refreshLogicalSessionCacheNow" : 1 }) + for shard in self.shards: + primary = (shard.mongo_client() if self.num_rs_nodes_per_shard is None else + shard.get_primary().mongo_client()) + primary.admin.command({"refreshLogicalSessionCacheNow": 1}) + def _auth_to_db(self, client): """Authenticate client for the 'authenticationDatabase'.""" if self.auth_options is not None: diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js index e9dd83a7a70..3615ec3562f 100644 --- a/src/mongo/shell/shardingtest.js +++ b/src/mongo/shell/shardingtest.js @@ -1558,6 +1558,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]) { + const rs = this._rs[i].test; + rs.getPrimary().getDB("admin").runCommand({_flushRoutingTableCacheUpdatesCmd: 1}); + } else { + this["shard" + i].getDB("admin").runCommand({_flushRoutingTableCacheUpdatesCmd: 1}); + } + } } }; |