summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/storage_engine.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/storage/storage_engine.h')
-rw-r--r--src/mongo/db/storage/storage_engine.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mongo/db/storage/storage_engine.h b/src/mongo/db/storage/storage_engine.h
index 1f97ad2d0d1..6452044ce30 100644
--- a/src/mongo/db/storage/storage_engine.h
+++ b/src/mongo/db/storage/storage_engine.h
@@ -372,8 +372,18 @@ public:
/**
* Sets the highest timestamp at which the storage engine is allowed to take a checkpoint.
* This timestamp can never decrease, and thus should be a timestamp that can never roll back.
+ *
+ * The maximumTruncationTimestamp (and newer) must not be truncated from the oplog in order to
+ * recover from the `stableTimestamp`. `boost::none` implies there are no additional
+ * constraints to what may be truncated.
+ *
+ * For proper truncation of the oplog, this method requires min(stableTimestamp,
+ * maximumTruncationTimestamp) to be monotonically increasing (where `min(stableTimestamp,
+ * boost::none) => stableTimestamp`). Otherwise truncation can race and remove a document
+ * before a call to this method protects it.
*/
- virtual void setStableTimestamp(Timestamp timestamp) {}
+ virtual void setStableTimestamp(Timestamp stableTimestamp,
+ boost::optional<Timestamp> maximumTruncationTimestamp) {}
/**
* Tells the storage engine the timestamp of the data at startup. This is necessary because