summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/storage/kv/kv_storage_engine.cpp3
-rw-r--r--src/mongo/db/transaction_participant.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/storage/kv/kv_storage_engine.cpp b/src/mongo/db/storage/kv/kv_storage_engine.cpp
index fe1ea716d72..4b55155450c 100644
--- a/src/mongo/db/storage/kv/kv_storage_engine.cpp
+++ b/src/mongo/db/storage/kv/kv_storage_engine.cpp
@@ -845,6 +845,9 @@ void KVStorageEngine::TimestampMonitor::startup() {
uOpCtx = client->makeOperationContext();
opCtx = uOpCtx.get();
}
+
+ ShouldNotConflictWithSecondaryBatchApplicationBlock shouldNotConflictBlock(
+ opCtx->lockState());
Lock::GlobalLock lock(opCtx, MODE_IS);
// The checkpoint timestamp is not cached in mongod and needs to be fetched with a
diff --git a/src/mongo/db/transaction_participant.cpp b/src/mongo/db/transaction_participant.cpp
index 548453ab45a..0260a0509f5 100644
--- a/src/mongo/db/transaction_participant.cpp
+++ b/src/mongo/db/transaction_participant.cpp
@@ -349,6 +349,9 @@ TransactionParticipant::getOldestActiveTimestamp(Timestamp stableTimestamp) {
auto opCtx = cc().makeOperationContext();
auto nss = NamespaceString::kSessionTransactionsTableNamespace;
auto deadline = Date_t::now() + Milliseconds(100);
+
+ ShouldNotConflictWithSecondaryBatchApplicationBlock shouldNotConflictBlock(
+ opCtx->lockState());
Lock::DBLock dbLock(opCtx.get(), nss.db(), MODE_IS, deadline);
Lock::CollectionLock collLock(opCtx.get(), nss, MODE_IS, deadline);