summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdi Zaimi <adizaimi@yahoo.com>2022-03-30 03:28:56 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-30 03:56:33 +0000
commit99fef0a19baad297ddd00843ec70d8f9d525fef1 (patch)
treeaec398f2041156d85aeda4028914dba5144b05a6
parent619914bd103c4e30184fb45e71f46f15c72edcc5 (diff)
downloadmongo-99fef0a19baad297ddd00843ec70d8f9d525fef1.tar.gz
SERVER-64996 Dump all locks before fasserting on RSTL timeout
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index 36ac01c19e6..0805cb25fe1 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -55,6 +55,7 @@
#include "mongo/db/commands.h"
#include "mongo/db/commands/feature_compatibility_version.h"
#include "mongo/db/concurrency/d_concurrency.h"
+#include "mongo/db/concurrency/lock_state.h"
#include "mongo/db/concurrency/replication_state_transition_lock_guard.h"
#include "mongo/db/curop.h"
#include "mongo/db/curop_failpoint_helpers.h"
@@ -2570,6 +2571,9 @@ ReplicationCoordinatorImpl::AutoGetRstlForStepUpStepDown::AutoGetRstlForStepUpSt
} catch (const ExceptionFor<ErrorCodes::LockTimeout>&) {
if (rstlTimeout > 0 && Date_t::now() - start >= Seconds(rstlTimeout)) {
+ // Dump all locks to identify which thread(s) are holding RSTL.
+ getGlobalLockManager()->dump();
+
auto lockerInfo =
opCtx->lockState()->getLockerInfo(CurOp::get(opCtx)->getLockStatsBase());
BSONObjBuilder lockRep;