summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjinichu <jinnybyun@gmail.com>2018-08-16 16:18:00 -0400
committerjinichu <jinnybyun@gmail.com>2018-08-16 16:18:00 -0400
commit36c1546add7887aeacb8228d289feac1b2d74c08 (patch)
tree3d3bf2aeeedf1303f22b99550bed34e05d8b9be7
parent15b6b95877b09d9a2c5d2f63a981692545875c3a (diff)
downloadmongo-36c1546add7887aeacb8228d289feac1b2d74c08.tar.gz
SERVER-35433 Log slow transactions when aborting under commits
-rw-r--r--src/mongo/db/session.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/session.cpp b/src/mongo/db/session.cpp
index 27b42bb2ad8..83139595f53 100644
--- a/src/mongo/db/session.cpp
+++ b/src/mongo/db/session.cpp
@@ -1054,6 +1054,12 @@ void Session::_commitTransaction(stdx::unique_lock<stdx::mutex> lk, OperationCon
// Update the LastClientInfo object stored in the SingleTransactionStats instance on
// the Session with this Client's information.
_singleTransactionStats->updateLastClientInfo(opCtx->getClient());
+
+ // Log the transaction if its duration is longer than the slowMS command threshold.
+ _logSlowTransaction(lk,
+ &(opCtx->lockState()->getLockerInfo())->stats,
+ MultiDocumentTransactionState::kAborted,
+ repl::ReadConcernArgs::get(opCtx));
}
}
// We must clear the recovery unit and locker so any post-transaction writes can run without