[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: |
|
||||
| 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 |