diff options
author | William Schultz <william.schultz@mongodb.com> | 2020-07-14 08:41:49 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-07-14 13:09:01 +0000 |
commit | 351b9a8d37dde2a79510c784421e29540cac007a (patch) | |
tree | 2dc646799d8b0e63923fab4c45e31459541e1dad | |
parent | d85570917048baa2920cc3785de0fea4d0b2ed2b (diff) | |
download | mongo-351b9a8d37dde2a79510c784421e29540cac007a.tar.gz |
SERVER-44349 Clean up some logging in replication recovery
-rw-r--r-- | src/mongo/db/repl/replication_recovery.cpp | 18 | ||||
-rw-r--r-- | src/mongo/db/repl/replication_recovery.h | 5 |
2 files changed, 10 insertions, 13 deletions
diff --git a/src/mongo/db/repl/replication_recovery.cpp b/src/mongo/db/repl/replication_recovery.cpp index 70dbcf35c08..00d772ac6ef 100644 --- a/src/mongo/db/repl/replication_recovery.cpp +++ b/src/mongo/db/repl/replication_recovery.cpp @@ -439,12 +439,12 @@ void ReplicationRecoveryImpl::recoverFromOplog(OperationContext* opCtx, fassert(40290, topOfOplogSW); const auto topOfOplog = topOfOplogSW.getValue(); - const auto appliedThrough = _consistencyMarkers->getAppliedThrough(opCtx); if (stableTimestamp) { invariant(supportsRecoveryTimestamp); - _recoverFromStableTimestamp(opCtx, *stableTimestamp, appliedThrough, topOfOplog); + _recoverFromStableTimestamp(opCtx, *stableTimestamp, topOfOplog); } else { - _recoverFromUnstableCheckpoint(opCtx, appliedThrough, topOfOplog); + _recoverFromUnstableCheckpoint( + opCtx, _consistencyMarkers->getAppliedThrough(opCtx), topOfOplog); } } catch (...) { LOGV2_FATAL_CONTINUE(21570, @@ -456,21 +456,17 @@ void ReplicationRecoveryImpl::recoverFromOplog(OperationContext* opCtx, void ReplicationRecoveryImpl::_recoverFromStableTimestamp(OperationContext* opCtx, Timestamp stableTimestamp, - OpTime appliedThrough, OpTime topOfOplog) { invariant(!stableTimestamp.isNull()); invariant(!topOfOplog.isNull()); - const auto truncateAfterPoint = _consistencyMarkers->getOplogTruncateAfterPoint(opCtx); - LOGV2(21544, "Recovering from stable timestamp: {stableTimestamp} (top of oplog: {topOfOplog}, " "appliedThrough: {appliedThrough}, TruncateAfter: {oplogTruncateAfterPoint})", "Recovering from stable timestamp", "stableTimestamp"_attr = stableTimestamp, "topOfOplog"_attr = topOfOplog, - "appliedThrough"_attr = appliedThrough, - "oplogTruncateAfterPoint"_attr = truncateAfterPoint); + "appliedThrough"_attr = _consistencyMarkers->getAppliedThrough(opCtx)); LOGV2(21545, "Starting recovery oplog application at the stable timestamp: {stableTimestamp}", @@ -576,9 +572,11 @@ void ReplicationRecoveryImpl::_applyToEndOfOplog(OperationContext* opCtx, Timestamp ReplicationRecoveryImpl::_applyOplogOperations(OperationContext* opCtx, const Timestamp& startPoint, const Timestamp& endPoint) { + // The oplog buffer will fetch all entries >= the startPoint timestamp, but it skips the first + // op on startup, which is why the startPoint is described as "exclusive". LOGV2(21550, - "Replaying stored operations from {startPoint} (inclusive) to {endPoint} (inclusive).", - "Replaying stored operations from startPoint (inclusive) to endPoint (inclusive)", + "Replaying stored operations from {startPoint} (exclusive) to {endPoint} (inclusive).", + "Replaying stored operations from startPoint (exclusive) to endPoint (inclusive)", "startPoint"_attr = startPoint, "endPoint"_attr = endPoint); diff --git a/src/mongo/db/repl/replication_recovery.h b/src/mongo/db/repl/replication_recovery.h index 597d3164337..7ea19301e97 100644 --- a/src/mongo/db/repl/replication_recovery.h +++ b/src/mongo/db/repl/replication_recovery.h @@ -97,7 +97,6 @@ private: */ void _recoverFromStableTimestamp(OperationContext* opCtx, Timestamp stableTimestamp, - OpTime appliedThrough, OpTime topOfOplog); /** @@ -109,7 +108,7 @@ private: OpTime topOfOplog); /** - * Applies all oplog entries from oplogApplicationStartPoint (inclusive) to topOfOplog + * Applies all oplog entries from oplogApplicationStartPoint (exclusive) to topOfOplog * (inclusive). This fasserts if oplogApplicationStartPoint is not in the oplog. */ void _applyToEndOfOplog(OperationContext* opCtx, @@ -117,7 +116,7 @@ private: const Timestamp& topOfOplog); /** - * Applies all oplog entries from startPoint (inclusive) to endPoint (inclusive). Returns the + * Applies all oplog entries from startPoint (exclusive) to endPoint (inclusive). Returns the * Timestamp of the last applied operation. */ Timestamp _applyOplogOperations(OperationContext* opCtx, |