-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
ALL
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When mongod is acting as a router in $unionWith or $lookup, we may not always record accurate data bearing node metrics on mongod/mongos if the $unionWith has to execute a getMore. Some metrics like docsExamined are accumulated through plan_summary_stats, but other metrics (bytesRead, cpuNanos, etc.) are not updated there.
It looks like we get the first batch metrics because we do aggregate the metrics directly from the first response off the cursorResponse. The lack of propagation occurs for getMores where the AsyncResultsMerger collects the cursorMetrics, but the unionWithStage only accumulatesPlanSummaryStats and drops the rest of the cursor metrics. Something similar is probably happening for $lookup as well.