diff options
author | matt dannenberg <matt.dannenberg@10gen.com> | 2015-08-04 05:06:14 -0400 |
---|---|---|
committer | matt dannenberg <matt.dannenberg@10gen.com> | 2015-08-06 03:06:02 -0400 |
commit | 3ac6afd27ae0beda8da6f999bf6867e474af3ce2 (patch) | |
tree | c20408423a6fe80f7496aa99dbb5e05dee6dbc1f /jstests/replsets/read_committed.js | |
parent | 250d661a5ed716795cfd277203f5afd24c59a23d (diff) | |
download | mongo-3ac6afd27ae0beda8da6f999bf6867e474af3ce2.tar.gz |
SERVER-19675 fix ReplicationMetadata populating and parsing
Diffstat (limited to 'jstests/replsets/read_committed.js')
-rw-r--r-- | jstests/replsets/read_committed.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/jstests/replsets/read_committed.js b/jstests/replsets/read_committed.js index 0871d5b3e9c..253b384b08a 100644 --- a/jstests/replsets/read_committed.js +++ b/jstests/replsets/read_committed.js @@ -12,15 +12,15 @@ var conns = replTest.startSet(); replTest.initiate({"_id": name, "members": [ { "_id": 0, "host": nodes[0] }, - { "_id": 1, "host": nodes[1] }, + { "_id": 1, "host": nodes[1], priority: 0 }, { "_id": 2, "host": nodes[2], arbiterOnly: true}] }); // Get connections and collection. -var master = replTest.getMaster(); -var slave = replTest.liveNodes.slaves[0]; -var slaveId = replTest.getNodeId(slave); -var db = master.getDB(name); +var primary = replTest.getPrimary(); +var secondary = replTest.liveNodes.slaves[0]; +var secondaryId = replTest.getNodeId(secondary); +var db = primary.getDB(name); var t = db[name]; if (!db.serverStatus().storageEngine.supportsCommittedReads) { @@ -46,7 +46,7 @@ assert.writeOK(t.save({_id: 1, state: 0}, {writeConcern: {w: "majority", wtimeou assert.eq(doDirtyRead(), 0); assert.eq(doCommittedRead(), 0); -replTest.stop(slaveId); +replTest.stop(secondaryId); // Do a write and ensure it is only visible to dirty reads assert.writeOK(t.save({_id: 1, state: 1})); @@ -59,11 +59,10 @@ sleep(1000); assert.eq(doCommittedRead(), 0); // Restart the node and ensure the committed view is updated. -replTest.restart(slaveId); -db.getLastError("majority", 60*1000); +replTest.restart(secondaryId); +db.getLastError("majority", 60 * 1000); assert.eq(doDirtyRead(), 1); assert.eq(doCommittedRead(), 1); -// Disable snapshots via failpoint and see the maxTimeMS works properly }()); |