system.profile and explain() changes due to query stats sampling

XMLWordPrintableJSON

    • Query Integration
    • ALL
    • v9.0
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Since SERVER-116390, 1% of queries enable query stats collection.

      For sharded subpipeline aggregation like $lookup and $unionWith, the subpipeline aggregation asks the shards to return their metrics when stats sampling is enabled. The returned DataBearingNodeMetrics is folded into PlanSummaryStats. Since PlanSummaryStats is what explain() and system.profile (and likely slow op logging) uses, at 1% chance we populate totalDocsExamined/totalKeysExamined (but not collectionScans/indexesUsed) on the subpipeline stage.

      This is an observable change which made 2 tests unstable (surfaced in BF-44570; fixed in SERVER-131960).

      This QI ticket is for visibility, and to assess if this is an acceptable behaviour change, and whether there is anything additional we need to do.

            Assignee:
            Unassigned
            Reporter:
            Vesko Karaganev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: