summaryrefslogtreecommitdiff
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-06 22:27:42 +0000
commit09e84e1b02db665a48ab6eb04b30909e7ca88494 (patch)
tree632f38b260b20de122e97f29f841558c9ea3df0a
parentaa21169ae956ff9f4a4fb9d867f8a74f6f629875 (diff)
downloadmongo-09e84e1b02db665a48ab6eb04b30909e7ca88494.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.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) +