diff options
author | Benety Goh <benety@mongodb.com> | 2019-07-24 21:06:51 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2019-07-24 21:07:10 -0400 |
commit | 3fb47996d10d3b8b01ba14e285d147e07c9370d3 (patch) | |
tree | d4e79a4a22f8faa2e0469c204120afd584caf3b1 /src/mongo | |
parent | f4399fceab41c4dfaad6b846b94e1366f67d93cd (diff) | |
download | mongo-3fb47996d10d3b8b01ba14e285d147e07c9370d3.tar.gz |
SERVER-42382 add index build UUID to lock manager diagnostic output
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/index_builds_coordinator.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/index_builds_coordinator.cpp b/src/mongo/db/index_builds_coordinator.cpp index d7dc7bf58d2..7fd6f697764 100644 --- a/src/mongo/db/index_builds_coordinator.cpp +++ b/src/mongo/db/index_builds_coordinator.cpp @@ -695,6 +695,18 @@ void IndexBuildsCoordinator::_runIndexBuild(OperationContext* opCtx, return it->second; }(); + // Add build UUID to lock manager diagnostic output. + auto locker = opCtx->lockState(); + auto oldLockerDebugInfo = locker->getDebugInfo(); + { + str::stream ss; + ss << "index build: " << replState->buildUUID; + if (!oldLockerDebugInfo.empty()) { + ss << "; " << oldLockerDebugInfo; + } + locker->setDebugInfo(ss); + } + auto status = [&]() { try { _runIndexBuildInner(opCtx, replState, indexBuildOptions); @@ -704,6 +716,8 @@ void IndexBuildsCoordinator::_runIndexBuild(OperationContext* opCtx, return Status::OK(); }(); + locker->setDebugInfo(oldLockerDebugInfo); + // Ensure the index build is unregistered from the Coordinator and the Promise is set with // the build's result so that callers are notified of the outcome. |