[SERVER-36796] "timeOfCreation" field in PlanCacheEntry is actually the time of the last transition to isActive:true Created: 21/Aug/18  Updated: 06/Dec/22

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

Type: Improvement Priority: Major - P3
Reporter: Ian Boros Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

There are cases where we overwrite the PlanCacheEntry stored in the cache, creating a new entry with a new "timeOfCreation". This means that the output of planCacheListPlans and $planCacheStats may be confusing. For example, when an inactive cache entry transitions to active, it will get a new "timeOfCreation" value.

See here:

https://github.com/mongodb/mongo/blob/7bc9953a256c1fab8b772812e712b909fefc4535/src/mongo/db/query/plan_cache.cpp#L776-L787



 Comments   
Comment by Ian Boros [ 08/Jun/20 ]

charlie.swanson I think that is what I would have proposed when I filed this. Maybe renaming 'timeOfCreation' to 'timeOfLastStateTransition' and then making sure 'timeOfCreation' is accurate.

It's been long enough that if this gets assigned out we should do some investigation first to make sure this is still an issue.

Comment by Charlie Swanson [ 08/Jun/20 ]

ian.boros is the proposed fix here to just not overwrite the timeOfCreation field? Otherwise I don't see how this is a "neweng" ticket.

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