summaryrefslogtreecommitdiff
path: root/src/mongo/db/transaction/transaction_participant.cpp
diff options
context:
space:
mode:
authorJiawei Yang <jiawei.yang@mongodb.com>2023-04-25 22:43:17 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-26 04:08:30 +0000
commit606e34054ef33e59b78715263b125ff7ebea1394 (patch)
tree85f8e6b1256096da4facc919bc6123db693a437f /src/mongo/db/transaction/transaction_participant.cpp
parent5c1f588bfa4ed2edbeb3abbb26e952e08641da14 (diff)
downloadmongo-606e34054ef33e59b78715263b125ff7ebea1394.tar.gz
SERVER-70127 change system operations to be killable by default
Diffstat (limited to 'src/mongo/db/transaction/transaction_participant.cpp')
-rw-r--r--src/mongo/db/transaction/transaction_participant.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/mongo/db/transaction/transaction_participant.cpp b/src/mongo/db/transaction/transaction_participant.cpp
index 25589761451..beb399820e8 100644
--- a/src/mongo/db/transaction/transaction_participant.cpp
+++ b/src/mongo/db/transaction/transaction_participant.cpp
@@ -572,6 +572,13 @@ TransactionParticipant::getOldestActiveTimestamp(Timestamp stableTimestamp) {
// the server, and it both blocks this thread from querying config.transactions and waits for
// this thread to terminate.
auto client = getGlobalServiceContext()->makeClient("OldestActiveTxnTimestamp");
+
+ // TODO(SERVER-74656): Please revisit if this thread could be made killable.
+ {
+ stdx::lock_guard<Client> lk(*client.get());
+ client.get()->setSystemOperationUnkillableByStepdown(lk);
+ }
+
AlternativeClientRegion acr(client);
try {
@@ -2013,8 +2020,14 @@ void TransactionParticipant::Participant::_commitSplitPreparedTxnOnPrimary(
auto splitClientOwned = userOpCtx->getServiceContext()->makeClient("tempSplitClient");
auto splitOpCtx = splitClientOwned->makeOperationContext();
- AlternativeClientRegion acr(splitClientOwned);
+ // TODO(SERVER-74656): Please revisit if this thread could be made killable.
+ {
+ stdx::lock_guard<Client> lk(*splitClientOwned.get());
+ splitClientOwned.get()->setSystemOperationUnkillableByStepdown(lk);
+ }
+
+ AlternativeClientRegion acr(splitClientOwned);
std::unique_ptr<MongoDSessionCatalog::Session> checkedOutSession;
repl::UnreplicatedWritesBlock notReplicated(splitOpCtx.get());
@@ -2236,8 +2249,14 @@ void TransactionParticipant::Participant::_abortSplitPreparedTxnOnPrimary(
auto splitClientOwned = opCtx->getServiceContext()->makeClient("tempSplitClient");
auto splitOpCtx = splitClientOwned->makeOperationContext();
- AlternativeClientRegion acr(splitClientOwned);
+ // TODO(SERVER-74656): Please revisit if this thread could be made killable.
+ {
+ stdx::lock_guard<Client> lk(*splitClientOwned.get());
+ splitClientOwned.get()->setSystemOperationUnkillableByStepdown(lk);
+ }
+
+ AlternativeClientRegion acr(splitClientOwned);
std::unique_ptr<MongoDSessionCatalog::Session> checkedOutSession;
repl::UnreplicatedWritesBlock notReplicated(splitOpCtx.get());