[SERVER-22252] Diagnostic log messages missing debug information for queries that encounter execution error Created: 20/Jan/16  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Diagnostics, Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: query-44-grooming
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File image.png    
Issue Links:
Related
related to SERVER-22250 Diagnostic log messages missing debug... Backlog
related to SERVER-15292 Failed update reports erroneous Write... Backlog
related to SERVER-17862 Unify stats reporting for log/profile... Closed
Assigned Teams:
Query Execution
Operating System: ALL
Participants:

 Description   

Stats information is not gathered for queries that encounter an execution error. As a result, the per-operation diagnostic messages logged for these queries are missing debug information, and the metrics counters tracked for serverStatus are not updated for these queries.

The following script will reproduce this issue:

var bigDoc = {a: new Array(15*1024*1024).join("x")};
db.setLogLevel(1);
db.foo.drop();
db.foo.insert([bigDoc, bigDoc, bigDoc]);
db.foo.find().sort({a: 1}).itcount();  // 32MB sort limit exceeded, triggers execution error.

When run against mongod version 3.2.1, the server generates the following diagnostic log line. Note that "nscanned" and "nscannedObjects" are not present.

2016-01-20T18:06:36.741-0500 I QUERY    [conn3] query test.foo query: { query: {}, orderby: { a: 1.0 } } planSummary: COLLSCAN ntoreturn:0 ntoskip:0 keyUpdates:0 writeConflicts:0 exception: Executor error: OperationFailed Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit. code:17144 numYields:1 reslen:184 locks:{ Global: { acquireCount: { r: 4 } }, MMAPV1Journal: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 2 } }, Collection: { acquireCount: { R: 2 } } } 21ms


Generated at Thu Feb 08 03:59:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.