diff options
Diffstat (limited to 'src/mongo/s/transaction_router_resource_yielder.cpp')
-rw-r--r-- | src/mongo/s/transaction_router_resource_yielder.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/s/transaction_router_resource_yielder.cpp b/src/mongo/s/transaction_router_resource_yielder.cpp index b0621f1792d..a5bfea59878 100644 --- a/src/mongo/s/transaction_router_resource_yielder.cpp +++ b/src/mongo/s/transaction_router_resource_yielder.cpp @@ -30,10 +30,13 @@ #include "mongo/s/transaction_router_resource_yielder.h" #include "mongo/db/session_catalog.h" +#include "mongo/logv2/log.h" #include "mongo/s/is_mongos.h" #include "mongo/s/session_catalog_router.h" #include "mongo/util/exit.h" +#define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kTransaction + namespace mongo { namespace { @@ -57,6 +60,11 @@ TransactionRouterResourceYielder::makeForRemoteCommand() { void TransactionRouterResourceYielder::yield(OperationContext* opCtx) { Session* const session = OperationContextSession::get(opCtx); if (session) { + LOGV2_DEBUG(6753700, + 5, + "TransactionRouterResourceYielder yielding", + "lsid"_attr = opCtx->getLogicalSessionId(), + "txnNumber"_attr = opCtx->getTxnNumber()); RouterOperationContextSession::checkIn(opCtx, OperationContextSession::CheckInReason::kYield); } @@ -66,6 +74,11 @@ void TransactionRouterResourceYielder::yield(OperationContext* opCtx) { void TransactionRouterResourceYielder::unyield(OperationContext* opCtx) { if (_yielded) { hangBeforeUnyieldingTransactionRouter.pauseWhileSet(); + LOGV2_DEBUG(6753701, + 5, + "TransactionRouterResourceYielder unyielding", + "lsid"_attr = opCtx->getLogicalSessionId(), + "txnNumber"_attr = opCtx->getTxnNumber()); // Code that uses the TransactionRouter assumes it will only run with it, so check back out // the session ignoring interruptions, except at global shutdown to prevent stalling |