summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Witten <andrew.witten@mongodb.com>2022-05-12 12:33:54 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-12 13:04:51 +0000
commited400508ab6a24923aa2243759d0d1730f9e684a (patch)
tree7a64e279329a2e5761e220d9630235bd76e4993a /src
parentaac0f3a9a159b51c29e8df95a1f8b626ca3cebb1 (diff)
downloadmongo-ed400508ab6a24923aa2243759d0d1730f9e684a.tar.gz
SERVER-66301 use waitForFailpoint command
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/s/transaction_coordinator.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/mongo/db/s/transaction_coordinator.cpp b/src/mongo/db/s/transaction_coordinator.cpp
index 69775f4209f..65b75e04a74 100644
--- a/src/mongo/db/s/transaction_coordinator.cpp
+++ b/src/mongo/db/s/transaction_coordinator.cpp
@@ -55,10 +55,13 @@ using TransactionCoordinatorDocument = txn::TransactionCoordinatorDocument;
MONGO_FAIL_POINT_DEFINE(hangBeforeWaitingForParticipantListWriteConcern);
MONGO_FAIL_POINT_DEFINE(hangBeforeWaitingForDecisionWriteConcern);
-ExecutorFuture<void> waitForMajorityWithHangFailpoint(ServiceContext* service,
- FailPoint& failpoint,
- const std::string& failPointName,
- repl::OpTime opTime) {
+ExecutorFuture<void> waitForMajorityWithHangFailpoint(
+ ServiceContext* service,
+ FailPoint& failpoint,
+ const std::string& failPointName,
+ repl::OpTime opTime,
+ const LogicalSessionId& lsid,
+ const TxnNumberAndRetryCounter& txnNumberAndRetryCounter) {
auto executor = Grid::get(service)->getExecutorPool()->getFixedExecutor();
auto waitForWC = [service, executor](repl::OpTime opTime) {
return WaitForMajorityService::get(service)
@@ -68,7 +71,11 @@ ExecutorFuture<void> waitForMajorityWithHangFailpoint(ServiceContext* service,
if (auto sfp = failpoint.scoped(); MONGO_unlikely(sfp.isActive())) {
const BSONObj& data = sfp.getData();
- LOGV2(22445, "Hit {failPointName} failpoint", "failPointName"_attr = failPointName);
+ LOGV2(22445,
+ "Hit {failPointName} failpoint",
+ "failPointName"_attr = failPointName,
+ "lsid"_attr = lsid,
+ "txnNumberAndRetryCounter"_attr = txnNumberAndRetryCounter);
// Run the hang failpoint asynchronously on a different thread to avoid self deadlocks.
return ExecutorFuture<void>(executor).then(
@@ -179,7 +186,9 @@ TransactionCoordinator::TransactionCoordinator(
_serviceContext,
hangBeforeWaitingForParticipantListWriteConcern,
"hangBeforeWaitingForParticipantListWriteConcern",
- std::move(opTime));
+ std::move(opTime),
+ _lsid,
+ _txnNumberAndRetryCounter);
})
.thenRunOn(Grid::get(_serviceContext)->getExecutorPool()->getFixedExecutor())
.then([this, apiParams] {
@@ -292,7 +301,9 @@ TransactionCoordinator::TransactionCoordinator(
return waitForMajorityWithHangFailpoint(_serviceContext,
hangBeforeWaitingForDecisionWriteConcern,
"hangBeforeWaitingForDecisionWriteConcern",
- std::move(opTime));
+ std::move(opTime),
+ _lsid,
+ _txnNumberAndRetryCounter);
})
.then([this, apiParams] {
{