summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/oplog_applier_impl.cpp
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2022-01-15 15:06:18 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-15 15:42:52 +0000
commite60858dc5165457c7c5f8574af8d2dead06143d0 (patch)
tree7ddd3fc76cd0b1ca9c1fda8af0b79ac66a931a2d /src/mongo/db/repl/oplog_applier_impl.cpp
parent584079c8c3dfe16741deb35e5e643c2f8637145b (diff)
downloadmongo-e60858dc5165457c7c5f8574af8d2dead06143d0.tar.gz
SERVER-58410: Make minValid writes untimestamped
Diffstat (limited to 'src/mongo/db/repl/oplog_applier_impl.cpp')
-rw-r--r--src/mongo/db/repl/oplog_applier_impl.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mongo/db/repl/oplog_applier_impl.cpp b/src/mongo/db/repl/oplog_applier_impl.cpp
index 9c8ea635089..c5ca80bb8d6 100644
--- a/src/mongo/db/repl/oplog_applier_impl.cpp
+++ b/src/mongo/db/repl/oplog_applier_impl.cpp
@@ -343,13 +343,9 @@ void OplogApplierImpl::_run(OplogBuffer* oplogBuffer) {
fassertNoTrace(34437, swLastOpTimeAppliedInBatch);
invariant(swLastOpTimeAppliedInBatch.getValue() == lastOpTimeInBatch);
- // Update various things that care about our last applied optime. Tests rely on 1 happening
- // before 2 even though it isn't strictly necessary.
+ // Update various things that care about our last applied optime.
- // 1. Persist our "applied through" optime to disk.
- _consistencyMarkers->setAppliedThrough(&opCtx, lastOpTimeInBatch);
-
- // 2. Ensure that the last applied op time hasn't changed since the start of this batch.
+ // 1. Ensure that the last applied op time hasn't changed since the start of this batch.
const auto lastAppliedOpTimeAtEndOfBatch = _replCoord->getMyLastAppliedOpTime();
invariant(lastAppliedOpTimeAtStartOfBatch == lastAppliedOpTimeAtEndOfBatch,
str::stream() << "the last known applied OpTime has changed from "
@@ -357,12 +353,12 @@ void OplogApplierImpl::_run(OplogBuffer* oplogBuffer) {
<< lastAppliedOpTimeAtEndOfBatch.toString()
<< " in the middle of batch application");
- // 3. Update oplog visibility by notifying the storage engine of the new oplog entries.
+ // 2. Update oplog visibility by notifying the storage engine of the new oplog entries.
const bool orderedCommit = true;
_storageInterface->oplogDiskLocRegister(
&opCtx, lastOpTimeInBatch.getTimestamp(), orderedCommit);
- // 4. Finalize this batch. The finalizer advances the global timestamp to lastOpTimeInBatch.
+ // 3. Finalize this batch. The finalizer advances the global timestamp to lastOpTimeInBatch.
finalizer->record({lastOpTimeInBatch, lastWallTimeInBatch});
}
}
@@ -501,7 +497,6 @@ StatusWith<OpTime> OplogApplierImpl::_applyOplogBatch(OperationContext* opCtx,
// Reset consistency markers in case the node fails while applying ops.
if (!getOptions().skipWritesToOplog) {
_consistencyMarkers->setOplogTruncateAfterPoint(opCtx, Timestamp());
- _consistencyMarkers->setMinValidToAtLeast(opCtx, ops.back().getOpTime());
}
{