summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/storage_interface_mock.h
diff options
context:
space:
mode:
authorDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-03-15 21:18:19 -0400
committerDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-03-15 21:18:19 -0400
commit8ab8025f23fb50d15336870a6cea4e4ca6f9673a (patch)
tree3b22cd47318b634ad6c939523cfbc317e3b57a2c /src/mongo/db/repl/storage_interface_mock.h
parent0abcf8f3cf547327c4dab4aea1ff22e1d75a8db8 (diff)
downloadmongo-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 'src/mongo/db/repl/storage_interface_mock.h')
-rw-r--r--src/mongo/db/repl/storage_interface_mock.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/repl/storage_interface_mock.h b/src/mongo/db/repl/storage_interface_mock.h
index b2b3d22f276..2e36f4a78cc 100644
--- a/src/mongo/db/repl/storage_interface_mock.h
+++ b/src/mongo/db/repl/storage_interface_mock.h
@@ -305,6 +305,12 @@ public:
return;
}
+ void oplogDiskLocRegister(OperationContext* opCtx,
+ const Timestamp& ts,
+ bool orderedCommit) override {
+ return;
+ }
+
// Testing functions.
CreateCollectionForBulkFn createCollectionForBulkFn =
[](const NamespaceString& nss,