[SERVER-57425] Avoid killing opCtx while holding the SessionCatalog mutex Created: 03/Jun/21  Updated: 29/Oct/23  Resolved: 07/Jul/21

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 5.0.2, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Janna Golden
Resolution: Fixed Votes: 0
Labels: sharding-csrs-stepdown-also, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Sharding 2021-07-12
Participants:
Linked BF Score: 127

 Description   

Killing an opCtx triggers the execution of tasks scheduled on its baton (see here). Some of those tasks may acquire locks, and this acquisition could violate the hierarchical lock acquisition invariants in the context of SessionCatalog.

Currently, the SessionCatalog kills operations (here) while holding a level 0 mutex (here). This ticket should change this behavior and have the operation killed without holding the SessionCatalog mutex.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 21/Jul/21 ]

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-57425 Change SessionCatalog mutex to level 4

(cherry picked from commit 6ef95120bfa20d8f5a4a4d2487c83b205d1fc152)
Branch: v5.0
https://github.com/mongodb/mongo/commit/89915783b53af0de21508da599987e1b843bb535

Comment by Githook User [ 07/Jul/21 ]

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-57425 Change SessionCatalog mutex to level 4
Branch: master
https://github.com/mongodb/mongo/commit/6ef95120bfa20d8f5a4a4d2487c83b205d1fc152

Comment by Githook User [ 17/Jun/21 ]

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-57425 Change SessionCatalog mutex to be level 1
Branch: master
https://github.com/mongodb/mongo/commit/1f3feae6738def99ca4b89dff504ec1c3d48562b

Comment by Tommaso Tocci [ 10/Jun/21 ]

Assigning to NYC since it is related to sessions

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