[SERVER-60698] Reduce performance change from StorageChangeContext Created: 14/Oct/21 Updated: 29/Oct/23 Resolved: 20/Oct/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.2.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matthew Russotto | Assignee: | Matthew Russotto |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | Repl 2021-10-18, Repl 2021-11-01 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 31 | ||||||||||||
| Description |
|
The API to allow storage change introduced a mutex in the OperationContext destroy path that increased median latency but decreased 95% latency in a perfomance microbenchmark (standalone inMemory genny_scale InsertRemoveTest.Remove). This replaces the mutex acquire with a simple test on OperationContext destruction; the mutex is now only acquired during storage change. This also closes a narrow race where the observer could be called before the storage change, the OperationContexts iterated, and then an OperationContext released without going through the StorageChangeContext::onOperationContextDestroy code. This would result in a hang. |
| Comments |
| Comment by Githook User [ 20/Oct/21 ] |
|
Author: {'name': 'Matthew Russotto', 'email': 'matthew.russotto@mongodb.com', 'username': 'mtrussotto'}Message: |