[SERVER-33870] COMMAND line does not show numYields Created: 14/Mar/18  Updated: 29/Oct/23  Resolved: 21/Jun/18

Status: Closed
Project: Core Server
Component/s: Logging, Write Ops
Affects Version/s: None
Fix Version/s: 4.1.1

Type: Improvement Priority: Major - P3
Reporter: Dmitry Agranat Assignee: Sam Mercier
Resolution: Fixed Votes: 1
Labels: neweng, storch
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: Query 2018-06-04, Query 2018-06-18, Query 2018-07-02
Participants:

 Description   

For each of the delete operations, we log two lines: a WRITE line and a COMMAND line which have mostly the same information, with the exception that the WRITE line shows numYields whereas the COMMAND line shows it as 0.



 Comments   
Comment by Githook User [ 21/Jun/18 ]

Author:

{'username': 'samontea', 'name': 'samontea', 'email': 'merciers.merciers@gmail.com'}

Message: SERVER-33870 make numYields of parent CurOps reflect child yields
Branch: master
https://github.com/mongodb/mongo/commit/d80d5ec7a75f6f32a27712ca4e904350318ce8c9

Comment by David Storch [ 11/Apr/18 ]

I confirmed this issue by generating the following example log lines:

2018-02-27T11:27:04.145-0500 I WRITE    [conn1] remove test.c query: { $or: [ { _id: 1.0 }, { _id: 2.0 } ] } ndeleted:2 keyUpdates:0 writeConflicts:0 numYields:1 locks:{ Global: { acquireCount: { r: 2, w: 2 } }, Database: { acquireCount: { w: 2 } }, Collection: { acquireCount: { w: 2 } } } 0ms
2018-02-27T11:27:04.145-0500 I COMMAND  [conn1] command test.$cmd command: delete { delete: "c", deletes: [ { q: { $or: [ { _id: 1.0 }, { _id: 2.0 } ] }, limit: 0.0 } ], ordered: true } keyUpdates:0 writeConflicts:0 numYields:0 reslen:25 locks:{ Global: { acquireCount: { r: 2, w: 2 } }, Database: { acquireCount: { w: 2 } }, Collection: { acquireCount: { w: 2 } } } protocol:op_command 0ms

This is a write batch consisting of a single multi-delete. We generate a log line for each statement in the batch, as well as a log line for the entire write command. You'll notice that the former log line reports a yield, but the latter includes the misleading string "numYields:0". This is a reporting bug; the server should probably just omit numYields for the log line in the COMMAND component. I suspect we can fix this by modifying the outer CurOp to indicate that it has no numYields value.

Generated at Thu Feb 08 04:34:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.