diff options
author | Esha Maharishi <esha.maharishi@mongodb.com> | 2020-05-06 18:49:07 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-07 17:49:43 +0000 |
commit | a8ad5db5bd820c8a9a851356fa394eecf2d2ea07 (patch) | |
tree | 91b6e82299ee35e4f6bcf6a42551cb54f93f8154 | |
parent | 32bdf48d824c7156fa26aa6a0dcf3665b09d792b (diff) | |
download | mongo-a8ad5db5bd820c8a9a851356fa394eecf2d2ea07.tar.gz |
SERVER-47999 balance_repl.js should ensure writes have replicated before attempting to read them from a secondary
-rw-r--r-- | jstests/sharding/balance_repl.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/jstests/sharding/balance_repl.js b/jstests/sharding/balance_repl.js index c36c0f636aa..83c92ff37b1 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 @@ var bulk = s.s0.getDB('TestDB').TestColl.initializeUnorderedBulkOp(); for (var i = 0; i < 2100; i++) { bulk.insert({_id: i, x: i}); } -assert.commandWorked(bulk.execute()); +assert.commandWorked(bulk.execute({w: "majority"})); assert.commandWorked(s.s0.adminCommand({enablesharding: 'TestDB'})); s.ensurePrimaryShard('TestDB', s.shard0.shardName); |