summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2020-04-02 14:20:42 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-03 19:59:43 +0000
commit85a915d3b49c0cd0b106f40df55a68a2f6779de1 (patch)
tree6ab324cb10e958e61e89625554f2bf2d7ab7fc53 /src/mongo
parent98e0d301535330cd57e3a777096b1c2508f1cc79 (diff)
downloadmongo-85a915d3b49c0cd0b106f40df55a68a2f6779de1.tar.gz
SERVER-29153 Wait for nodes to agree on primary before writes in ShardingTest setup
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/shell/shardingtest.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js
index 39a41fb2d6e..e222bacc090 100644
--- a/src/mongo/shell/shardingtest.js
+++ b/src/mongo/shell/shardingtest.js
@@ -1490,6 +1490,7 @@ var ShardingTest = function(params) {
}
var rs = this._rs[i].test;
+ rs.awaitNodesAgreeOnPrimary();
rs.getPrimary().getDB("admin").foo.save({x: 1});
if (this.keyFile) {
@@ -1512,6 +1513,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();
print("ShardingTest startup and initiation for all nodes took " + (new Date() - startTime) +