summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2020-05-06 18:49:07 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-07 19:10:38 +0000
commit53f640abde82c6e3f19db2824350000615065fbe (patch)
tree7c2a25b92362dff1a22e622285c26aa1dff55803
parent2c7a53f74cd6f588cca2ab968a9263d59c56684c (diff)
downloadmongo-53f640abde82c6e3f19db2824350000615065fbe.tar.gz
SERVER-47999 balance_repl.js should ensure writes have replicated before attempting to read them from a secondary
(cherry picked from commit 22cd836e61cac4838abf4dd4d72ad7119b2715e9)
-rw-r--r--jstests/sharding/balance_repl.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/jstests/sharding/balance_repl.js b/jstests/sharding/balance_repl.js
index 02e2c54bbc0..1074d2f4f81 100644
--- a/jstests/sharding/balance_repl.js
+++ b/jstests/sharding/balance_repl.js
@@ -5,22 +5,22 @@
(function() {
'use strict';
- // The mongod secondaries are set to priority 0 and votes 0 to prevent the primaries
- // from stepping down during migrations on slow evergreen builders.
+ // The mongod secondaries are set to priority 0 to prevent the primaries from stepping down
+ // during migrations on slow evergreen builders.
var s = new ShardingTest({
shards: 2,
other: {
chunkSize: 1,
rs0: {
nodes: [
- {rsConfig: {votes: 1}},
- {rsConfig: {priority: 0, votes: 0}},
+ {rsConfig: {}},
+ {rsConfig: {priority: 0}},
],
},
rs1: {
nodes: [
- {rsConfig: {votes: 1}},
- {rsConfig: {priority: 0, votes: 0}},
+ {rsConfig: {}},
+ {rsConfig: {priority: 0}},
],
}
}
@@ -30,7 +30,7 @@
for (var i = 0; i < 2100; i++) {
bulk.insert({_id: i, x: i});
}
- assert.writeOK(bulk.execute());
+ assert.writeOK(bulk.execute({w: "majority"}));
assert.commandWorked(s.s0.adminCommand({enablesharding: 'TestDB'}));
s.ensurePrimaryShard('TestDB', s.shard0.shardName);