AdditiveMetrics reports queuing metrics only for execution control

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL
    • CAR Team 2026-08-17
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Motivation

      SERVER-132626 broadened workingTimeMillis to exclude queueing at every admission gate (ingress, ingress_request, execution, writeThrottle) via _sumBlockedTimeTotal, which walks TicketHolderQueueStats::getQueueMetricsRegistry().

      However, queryExec.totalTimeQueuedMicros and queryExec.totalAdmissions are still sourced only from ExecutionAdmissionContext. Both CurOp::_setEndOfOpMetrics and CurOp::reportState are reporting queuing metrics that appear to be for the entirety of execution but are really from the ExecutionAdmissionContext. This will miss any other admission gate the operation interacted at and possibly queued.

      Fix

      Mirror the pattern in _sumBlockedTimeTotal: replace the single ExecutionAdmissionContext::get(opCtx) lookup in both CurOp::_setEndOfOpMetrics and CurOp::reportState with a loop over TicketHolderQueueStats::getQueueMetricsRegistry() like:

      for (auto&& [queueType, lookup] : TicketHolderQueueStats::getQueueMetricsRegistry()) {
        ... += lookup(opCtx())->totalTimeQueuedMicros();
      } 

            Assignee:
            Wolfee Farkas
            Reporter:
            Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: