Record updateLookup metrics from the Aggregation lookup executor

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      The Aggregation executor is the universal fallback and the entire lookup path when the IFR flag is
      off — the executor running in production today. Instrumenting it first lands a working end-to-end
      metric on the safest path.

      Scope

      • Add a SingleDocumentLookupStatsRecorder constructor parameter to AggregationSingleDocumentLookupExecutor; store it.
      • In performLookup, call recordFound / recordNotFound with the measured latency. The Aggregation executor always handles the lookup (it is the universal fallback and never returns kNotHandled), so it never records notHandled.
      • Update the stage-build factory (makeUpdateLookupStage site) to inject the updateLookupAggregationStats cell.

      Acceptance

      With the IFR flag OFF, a stream with updates increments changeStreams.updateLookup.aggregation.found / notFound and the latency histogram.

      Tests (definition of done)

      Create the shared replset jstest jstests/change_streams/change_stream_metrics_update_lookup.js:

      • tagged assumes_against_mongod_not_mongos + assumes_read_preference_unchanged + assumes_no_implicit_cursor_exhaustion (per the change_stream_metrics_* family).
      • baseline -> operate -> delta on serverStatus.
      • flag-off branch: assert the aggregation cell increments.
      • topology-agnostic invariants (found + notFound + notHandled reconcile; monotonic).
      • compute the expected cell as expectedEngine(flag, changeStreamPassthroughType()) so the Express and SBE wiring tickets can add their branches without restructuring.

      Dependencies

      Depends on the metrics infrastructure ticket, and AggregationSingleDocumentLookupExecutor (SERVER-128409).

            Assignee:
            Denis Grebennicov
            Reporter:
            Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: