[SERVER-80878] query stats store size serverStatus metric can go below 0 Created: 07/Sep/23  Updated: 31/Oct/23  Resolved: 13/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.1, 7.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Memento Slack Bot Assignee: Alyssa Clark
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-85099 Tracking: Milestone 1 Closed
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.1
Sprint: QI 2023-09-18
Participants:

 Description   

My in-progress patch for SERVER-79736 reveals that making a copy of a QueryStatsEntry is permitted, and it will call the copy constructor which is compiler generated and will not increment the server status metric, but then it will eventually call the destructor which will update the server status metric in the negative direction. So I think this means that if you invoke $queryStats we'll make copies of everything and decrement the counters. My patch makes it worse

It looks like the LRUKeyValue has a size tracker that could be customized to report metrics on its size, but it currently only exposes a customization option for the 'what is the size of this particular thing' part of it.



 Comments   
Comment by Githook User [ 31/Oct/23 ]

Author:

{'name': 'Alyssa Wagenmaker', 'email': 'alyssa.wagenmaker@mongodb.com', 'username': 'awagenmaker'}

Message: SERVER-80878 Add QueryStatsStore insertion/eviction listener to track size
Branch: v7.1
https://github.com/mongodb/mongo/commit/eb55125b8dd46516b4b4cf827c6b38968252e742

Comment by Githook User [ 13/Sep/23 ]

Author:

{'name': 'Alyssa Wagenmaker', 'email': 'alyssa.wagenmaker@mongodb.com', 'username': 'awagenmaker'}

Message: SERVER-80878 Add QueryStatsStore insertion/eviction listener to track size
Branch: master
https://github.com/mongodb/mongo/commit/b9235dbace065846cc17937201c8eac9582bfd98

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