-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Overview
bulkWrite slow query logs have two correctness problems.
Background
* No queryShapeHash. Each op of a bulkWrite is logged as its own per-op "Slow query" entry (type: "msg"), but none include a queryShapeHash -- unlike standalone insert/update/delete.
* Wrong command-level entry. The top-level bulkWrite entry logs ns: "admin.\$cmd" and collectionType: "admin", even though the ops target other namespaces via nsInfo. It also reports {{nreturned: }}.
Fix Sketch
* Compute the query shape hash per bulkWrite op (per-op query-stats context already exists via OpDebug::_queryStatsInfoForBatchWrites).
* Decide the intended command-level ns/collectionType: derive from the targets in nsInfo when ops share a namespace, or omit collectionType when undeterminable.
Test Re-enable
In jstests/noPassthrough/logging/log_write_command_fields.js, flip it.skip to it for the two "BULKWRITE TODO SERVER-XXXXX ..." tests and replace SERVER-XXXXX with this ticket number. The enabled bulkWrite per-op test currently pins expectQueryShapeHash: false; flip those to true.
Acceptance Criteria
* Per-op bulkWrite slow query entries include a well-formed queryShapeHash.
* Command-level bulkWrite entry reports a meaningful ns/collectionType (per-target, or the field omitted).
* The re-enabled tests above pass.
- is related to
-
SERVER-122926 Add jstest coverage for write command slow query logs
-
- Closed
-