diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2020-04-02 14:20:42 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-06 22:53:48 +0000 |
commit | f9170b2a35d3ab9d1d6d7669d1bacf9da785a94d (patch) | |
tree | 07f85382eb23ad962e807ad377eb4eed1ff7ece5 | |
parent | 6894f176cac940406c9de66b3d091c2e6044afc3 (diff) | |
download | mongo-f9170b2a35d3ab9d1d6d7669d1bacf9da785a94d.tar.gz |
SERVER-29153 Wait for nodes to agree on primary before writes in ShardingTest setup
(cherry picked from commit 85a915d3b49c0cd0b106f40df55a68a2f6779de1)
-rw-r--r-- | src/mongo/shell/shardingtest.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js index 2e5a10c3062..dab5a98b4e2 100644 --- a/src/mongo/shell/shardingtest.js +++ b/src/mongo/shell/shardingtest.js @@ -1371,6 +1371,7 @@ var ShardingTest = function(params) { } var rs = this._rs[i].test; + rs.awaitNodesAgreeOnPrimary(); rs.getPrimary().getDB("admin").foo.save({x: 1}); if (keyFile) { @@ -1438,6 +1439,7 @@ var ShardingTest = function(params) { this.configRS.initiateWithAnyNodeAsPrimary(config); // Wait for master to be elected before starting mongos + this.configRS.awaitNodesAgreeOnPrimary(); var csrsPrimary = this.configRS.getPrimary(); // If 'otherParams.mongosOptions.binVersion' is an array value, then we'll end up constructing a |