mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 09:06:21 +01:00
SERVER-19890 fix jstests/replsets/read_committed_no_snapshots.js to use lastOpVisible
This commit is contained in:
parent
4cf56d86a3
commit
2475abdf1f
@ -35,12 +35,19 @@ if (!db.serverStatus().storageEngine.supportsCommittedReads) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do a write, wait for it to replicate, and ensure it is visible.
|
// Do a write, wait for it to replicate, and ensure it is visible.
|
||||||
assert.writeOK(db.foo.save({_id: 1, state: 0}, {writeConcern: {w: "majority", wtimeout: 60*1000}}));
|
var res = db.runCommandWithMetadata(
|
||||||
|
"insert",
|
||||||
|
{
|
||||||
|
insert: "foo",
|
||||||
|
documents: [{_id: 1, state: 0}],
|
||||||
|
writeConcern: {w: "majority", wtimeout: 60*1000}
|
||||||
|
},
|
||||||
|
{"$replData": 1});
|
||||||
|
assert.commandWorked(res.commandReply);
|
||||||
|
|
||||||
// We need to propagate the lastOp from the primary as afterOpTime in the secondary to ensure we
|
// We need to propagate the lastOpVisible from the primary as afterOpTime in the secondary to ensure
|
||||||
// wait for the write to be in the majority committed view.
|
// we wait for the write to be in the majority committed view.
|
||||||
// TODO SERVER-19890 Fix this to get the real optime rather than constructing a fake one.
|
var lastOp = res.metadata["$replData"].lastOpVisible;
|
||||||
var lastOp = {ts: db.getLastErrorObj().lastOp, term: 1};
|
|
||||||
|
|
||||||
secondary.setSlaveOk();
|
secondary.setSlaveOk();
|
||||||
// Timeout is based on heartbeat timeout.
|
// Timeout is based on heartbeat timeout.
|
||||||
|
Loading…
Reference in New Issue
Block a user