[SERVER-45687] Replace mutex in CollectionShardingRuntime with CSRLock Created: 21/Jan/20  Updated: 18/Feb/20  Resolved: 18/Feb/20

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

Type: Bug Priority: Major - P3
Reporter: Matthew Saltz (Inactive) Assignee: Matthew Saltz (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Operating System: ALL
Sprint: Sharding 2020-01-27, Sharding 2020-02-24
Participants:
Linked BF Score: 0

 Description   

This mutex is redundant and hurts performance and the CSRLock can be used instead.



 Comments   
Comment by Matthew Saltz (Inactive) [ 18/Feb/20 ]

After implementing this, it turns out that using a SharedLock on the CSR ResourceMutex was actually worse for performance, as seen in the run of bulk_shard_insert.js here (20 min compared to usual 9 min). In retrospect, this makes sense, since SharedLock in general is much more heavyweight and isn't particularly useful with short critical sections.

Comment by Matthew Saltz (Inactive) [ 27/Jan/20 ]

It turns out the major perf hit was due to SERVER-45691, so I'll postpone doing this one for the moment in favor of functionality-adding tickets, but we should do it before releasing.

Generated at Thu Feb 08 05:09:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.