[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:
Depends
Related
related to SERVER-57811 API to start storage with alternate l... Closed
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: SERVER-60698 Reduce performance change from adding StorageChangeContext.
Branch: master
https://github.com/mongodb/mongo/commit/1c0341adb59b9a506e1c4f0aecc21bbd5902c332

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