summaryrefslogtreecommitdiff
path: root/src/mongo/db/repair.cpp
diff options
context:
space:
mode:
authorDaniel Gottlieb <daniel.gottlieb@mongodb.com>2022-07-25 14:45:21 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-07-26 17:57:14 +0000
commitc90a8e578049d9921175fcd7db5f3e1becfa9076 (patch)
treed0567a9d61ea12801e13f225a95f837510287703 /src/mongo/db/repair.cpp
parentaa6a253f8b9c9023377870d47240784679077a0a (diff)
downloadmongo-c90a8e578049d9921175fcd7db5f3e1becfa9076.tar.gz
SERVER-65971: Have _restoreTxnsTableEntryFromRetryableWrites declare its intent as an untimestamped write.
Diffstat (limited to 'src/mongo/db/repair.cpp')
-rw-r--r--src/mongo/db/repair.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/repair.cpp b/src/mongo/db/repair.cpp
index c880b32487b..a6f8029be24 100644
--- a/src/mongo/db/repair.cpp
+++ b/src/mongo/db/repair.cpp
@@ -71,6 +71,13 @@ using namespace fmt::literals;
Status rebuildIndexesForNamespace(OperationContext* opCtx,
const NamespaceString& nss,
StorageEngine* engine) {
+ if (opCtx->recoveryUnit()->isActive()) {
+ // This function is shared by multiple callers. Some of which have opened a transaction to
+ // perform reads. This function may make mixed-mode writes. Mixed-mode assertions can only
+ // be suppressed when beginning a fresh transaction.
+ opCtx->recoveryUnit()->abandonSnapshot();
+ }
+
opCtx->checkForInterrupt();
auto collection = CollectionCatalog::get(opCtx)->lookupCollectionByNamespace(opCtx, nss);
auto swIndexNameObjs = getIndexNameObjs(collection);