diff options
author | Benety Goh <benety@mongodb.com> | 2017-06-09 11:34:11 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2017-06-13 21:34:22 -0400 |
commit | 04130f4b62a52b6c40d216fb57055738562ce53c (patch) | |
tree | c2dfd16167ca2e46db2ff7ccac099c12d98735a1 /jstests | |
parent | c6dddd2e43f150793da4a6201758fd48db33e025 (diff) | |
download | mongo-04130f4b62a52b6c40d216fb57055738562ce53c.tar.gz |
SERVER-29536 reduce number of data-bearing nodes in apply_batch_only_goes_forward.js from 3 to 2
(cherry picked from commit 49c02153a4996e61bf5c3e35398eb30397e8ae01)
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/replsets/apply_batch_only_goes_forward.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/jstests/replsets/apply_batch_only_goes_forward.js b/jstests/replsets/apply_batch_only_goes_forward.js index 2b91d042d49..f14f7c05168 100644 --- a/jstests/replsets/apply_batch_only_goes_forward.js +++ b/jstests/replsets/apply_batch_only_goes_forward.js @@ -21,7 +21,8 @@ return new Date(ts.getTime() * 1000); } - var replTest = new ReplSetTest({name: "apply_batch_only_goes_forward", nodes: 3}); + var replTest = + new ReplSetTest({name: "apply_batch_only_goes_forward", nodes: [{}, {}, {arbiter: true}]}); var nodes = replTest.startSet(); replTest.initiate(); @@ -39,10 +40,10 @@ // Write op assert.writeOK( - mTest.foo.save({}, {writeConcern: {w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); + mTest.foo.save({}, {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); replTest.waitForState(slave, ReplSetTest.State.SECONDARY); assert.writeOK( - mTest.foo.save({}, {writeConcern: {w: 3, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); + mTest.foo.save({}, {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); // Set minvalid to something far in the future for the current primary, to simulate recovery. // Note: This is so far in the future (5 days) that it will never become secondary. @@ -63,7 +64,9 @@ {ts: farFutureTS, t: NumberLong(-1), begin: primaryOpTime}, {upsert: true, writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}}))); - jsTest.log("restart primary"); + jsTest.log('Restarting primary ' + master.host + + ' with updated minValid. This node will go into RECOVERING upon restart. ' + + 'Secondary ' + slave.host + ' will become new primary.'); clearRawMongoProgramOutput(); replTest.restart(master); printjson(sLocal.adminCommand("isMaster")); @@ -73,7 +76,7 @@ // considered as a sync source - this is more relevant to PV0 because we do not write a new // entry to the oplog on becoming primary. assert.writeOK(replTest.getPrimary().getDB("test").foo.save( - {}, {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); + {}, {writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}})); // Sync source selection will log this message if it does not detect min valid in the sync // source candidate's oplog. |