SERVER-115371 Delinquency stats are inaccurate for operations with children (#45173)

GitOrigin-RevId: 98743658eb9ff65d0498284f92f75b9ce0b973fb
This commit is contained in:
Pol Piñol Castuera 2025-12-15 09:33:46 +01:00 committed by MongoDB Bot
parent 62201d43f1
commit a12522f494
1 changed files with 4 additions and 1 deletions

View File

@ -805,7 +805,10 @@ bool CurOp::completeAndLogOperation(const logv2::LogOptions& logOptions,
_updateExecutionTimers();
if (!opCtx->inMultiDocumentTransaction()) {
// Record execution and delinquency stats for the top-level operation only. We don't want to
// double count stats from child operations (e.g., bulk writes, sub-operations in aggregations)
// that share the same ExecutionAdmissionContext.
if (!parent() && !opCtx->inMultiDocumentTransaction()) {
// If we're not in a txn, we record information about delinquent ticket acquisitions to the
// Queue's stats.
if (auto ticketingSystem =