summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/recovery_unit_noop.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/storage/recovery_unit_noop.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/storage/recovery_unit_noop.h')
-rw-r--r--src/mongo/db/storage/recovery_unit_noop.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/db/storage/recovery_unit_noop.h b/src/mongo/db/storage/recovery_unit_noop.h
index d8f7e69adb1..0dbc41de3d5 100644
--- a/src/mongo/db/storage/recovery_unit_noop.h
+++ b/src/mongo/db/storage/recovery_unit_noop.h
@@ -80,6 +80,8 @@ public:
return SnapshotId();
}
+ virtual void setOrderedCommit(bool orderedCommit) {}
+
private:
std::vector<std::unique_ptr<Change>> _changes;
};