[SERVER-78783] Reduce contention by including thread name in query stats store key Created: 07/Jul/23  Updated: 27/Oct/23  Resolved: 19/Sep/23

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

Type: Task Priority: Major - P3
Reporter: Charlie Swanson Assignee: William Qian
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-85055 Tracking: M1 Performance improvement ... Closed
Related
Assigned Teams:
Query Optimization
Participants:

 Description   

This idea was floated by schwerin@mongodb.com during the design review. I've attached a prototype patch that didn't seem to show meaningful improvement. However, this might prove helpful or necessary depending on the outcome of ongoing investigations



 Comments   
Comment by William Qian [ 19/Sep/23 ]

Not going to implement this because it causes read consistency issues that can only be resolved with what is essentially a global lock.

Comment by William Qian [ 18/Sep/23 ]

As discussed, there is a potential read consistency issue if we introduce thread description as a part of the partition key. See https://github.com/10gen/mongo/pull/15484 for code that implements partitioning by thread description, based on Charlie's patch. By introducing thread description into the partition key, we now have to choose between holding partition locks for much longer (impractical) or accepting inconsistent reads (incorrect).

Comment by Charlie Swanson [ 07/Jul/23 ]

Here is the patch where I gave it a go: https://spruce.mongodb.com/version/64a6e7e32a60ed07a2e90216/changes?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC

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