summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2023-01-10 23:13:48 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-11 00:12:05 +0000
commit07b4b22983295b4d332961801dce47f5a027b90d (patch)
treeb452c82afcdbf9485e586443ea22b997ba754727 /src/mongo/db
parent03a8fabfea57bf6b496907467421559e68cf5d25 (diff)
downloadmongo-07b4b22983295b4d332961801dce47f5a027b90d.tar.gz
SERVER-69193 Timestamp index build aborts during the oplog replay phase of initial sync
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/repl/oplog.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index 2428f57a566..c7d94986609 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -2072,6 +2072,10 @@ Status applyCommand_inlock(OperationContext* opCtx,
}
case ErrorCodes::BackgroundOperationInProgressForDatabase: {
invariant(mode == OplogApplication::Mode::kInitialSync);
+
+ // Aborting an index build involves writing to the catalog. This write needs to be
+ // timestamped. It will be given 'writeTime' as the commit timestamp.
+ TimestampBlock tsBlock(opCtx, writeTime);
abortIndexBuilds(opCtx,
entry.getCommandType(),
nss,
@@ -2091,6 +2095,10 @@ Status applyCommand_inlock(OperationContext* opCtx,
// This error is only possible during initial sync mode.
invariant(mode == OplogApplication::Mode::kInitialSync);
+
+ // Aborting an index build involves writing to the catalog. This write needs to be
+ // timestamped. It will be given 'writeTime' as the commit timestamp.
+ TimestampBlock tsBlock(opCtx, writeTime);
abortIndexBuilds(
opCtx, entry.getCommandType(), ns, "Aborting index builds during initial sync");
LOGV2_DEBUG(4665901,