summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/replication_recovery.cpp
diff options
context:
space:
mode:
authorJason Chan <jason.chan@mongodb.com>2021-04-28 19:53:03 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-04 22:29:28 +0000
commit320e2d28396c250dfd69640dcf865dff50ea0b55 (patch)
treee5ddaba95d3c5ee27ee386137a74435b17637993 /src/mongo/db/repl/replication_recovery.cpp
parent4aa27885874b90e098c1225fccb10f4daa3b3d38 (diff)
downloadmongo-320e2d28396c250dfd69640dcf865dff50ea0b55.tar.gz
SERVER-55305 Add new step to replication rollback to restore the txns table to be consistent with the stableTimestamp
Diffstat (limited to 'src/mongo/db/repl/replication_recovery.cpp')
-rw-r--r--src/mongo/db/repl/replication_recovery.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/repl/replication_recovery.cpp b/src/mongo/db/repl/replication_recovery.cpp
index c9d4aa3c381..2bc00bfefe2 100644
--- a/src/mongo/db/repl/replication_recovery.cpp
+++ b/src/mongo/db/repl/replication_recovery.cpp
@@ -60,6 +60,8 @@
namespace mongo {
namespace repl {
+MONGO_FAIL_POINT_DEFINE(hangAfterOplogTruncationInRollback);
+
namespace {
const auto kRecoveryBatchLogLevel = logv2::LogSeverity::Debug(2);
@@ -449,6 +451,8 @@ void ReplicationRecoveryImpl::recoverFromOplog(OperationContext* opCtx,
// This may take an IS lock on the oplog collection.
_truncateOplogIfNeededAndThenClearOplogTruncateAfterPoint(opCtx, &stableTimestamp);
+ hangAfterOplogTruncationInRollback.pauseWhileSet();
+
auto topOfOplogSW = _getTopOfOplog(opCtx);
if (topOfOplogSW.getStatus() == ErrorCodes::CollectionIsEmpty ||
topOfOplogSW.getStatus() == ErrorCodes::NamespaceNotFound) {