[SERVER-84300] Avoid reading the clock to compute $$NOW Created: 19/Dec/23  Updated: 20/Dec/23  Resolved: 20/Dec/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Charlie Swanson Assignee: Charlie Swanson
Resolution: Fixed Votes: 0
Labels: flag-for-2885-backport
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-85065 Tracking: M3 Tech Debt Tickets Closed
Related
is related to SERVER-79736 Hash C++ data structures directly rat... Closed
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 5

 Description   

erin.zhu@mongodb.com noticed this show up in some of our query stats profiles while investigating perf changes caused by SERVER-79736. I don't think there's any reason we need to go into "Date_t::now()" to populate this variable. Definitely we shouldn't need to for the purposes of reporting query stats. But also in general we may be able to share a clock read from the CurOp object or something rather than re-read the clock which can involve a mutex for a VectorClock.

Specifically in cmd_with_let_shape.cpp in makeDummyExpCtx, it ends up calling generateRuntimeConstants in variables.cpp where it takes the VectorClock mutex. Actually, this is the path as of SERVER-79736, looks like it has changed since then but I assume its doing something similar. 



 Comments   
Comment by Githook User [ 20/Dec/23 ]

Author:

{'name': 'Charlie Swanson', 'email': 'charlie.swanson@mongodb.com', 'username': 'cswanson310'}

Message: SERVER-84300 Avoid reading the clocks to report query stats (#17689)

GitOrigin-RevId: 07b392034ba31b422ac623b36cad8982ed25243f
Branch: master
https://github.com/mongodb/mongo/commit/6ee82c1062a20b195dcedee81b27f6ee4e6165a3

Comment by Charlie Swanson [ 20/Dec/23 ]

Punting this out of PM-2885 and leaving assigned to charlie.swanson@mongodb.com to resolve. We are closing the epic since all customer-focused work is complete.

Generated at Thu Feb 08 06:54:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.