diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2018-03-15 21:18:19 -0400 |
---|---|---|
committer | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2018-03-15 21:18:19 -0400 |
commit | 8ab8025f23fb50d15336870a6cea4e4ca6f9673a (patch) | |
tree | 3b22cd47318b634ad6c939523cfbc317e3b57a2c /jstests/noPassthroughWithMongod/query_oplogreplay.js | |
parent | 0abcf8f3cf547327c4dab4aea1ff22e1d75a8db8 (diff) | |
download | mongo-8ab8025f23fb50d15336870a6cea4e4ca6f9673a.tar.gz |
SERVER-33846: Set oplog visibility synchronously on secondaries, at the end of every batch.
This patch introduces an optimization to allow secondaries to set their
visibility synchronously with oplog application as well as bypassing
additional journal flushing meant for primaries. Primaries replicating oplog
entries atomically generate a new optime and pass it to the storage engine's
oplog record store via the `oplogDiskLocRegister` method. This code path
will now pass in a parameter `orderedCommit = false` that alerts the storage
engine to maintain the necessary oplog visibility semantics for that write.
This is existing behavior, the only difference is the addition of the
`orderedCommit` parameter.
Secondaries will now also call `oplogDiskLocRegister` at the end of every
batch. This call will pass in the optime of the last oplog entry applied and
`orderedCommit = true`. A storage engine may take this as a guarantee that
there are no oplog holes prior to the input optime.
Diffstat (limited to 'jstests/noPassthroughWithMongod/query_oplogreplay.js')
-rw-r--r-- | jstests/noPassthroughWithMongod/query_oplogreplay.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/jstests/noPassthroughWithMongod/query_oplogreplay.js b/jstests/noPassthroughWithMongod/query_oplogreplay.js index a06a7bc2c8e..36e286f917d 100644 --- a/jstests/noPassthroughWithMongod/query_oplogreplay.js +++ b/jstests/noPassthroughWithMongod/query_oplogreplay.js @@ -199,9 +199,11 @@ assert(!cursor.hasNext()); } + jsTestLog("Non-oplog."); // Test that oplog replay on a non-oplog collection succeeds. test(db.jstests_query_oplogreplay); + jsTestLog("Oplog."); // Test that oplog replay on the actual oplog succeeds. test(db.getSiblingDB("local").oplog.jstests_query_oplogreplay); |