[SERVER-76652] createRandomCursorExecutor holds the CSSLock while potentially executing a TrialStage Created: 28/Apr/23  Updated: 29/Oct/23  Resolved: 29/Apr/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc1

Type: Bug Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
is caused by SERVER-69435 Make the CSS acquisition a RAII Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0
Sprint: Sharding EMEA 2023-05-01
Participants:
Linked BF Score: 119

 Description   

PipelineD::createRandomCursorExecutor takes a ScopedCollectionShardingState, which holds the CSS RESOURCE_MUTEX, and still holds it when it constructs the PlanExecutor. The PlanExecutor constructor may actually execute a TrialStage, during which it can yield/restore the locks. RESOURCE_MUTEXes are not yielded, so on restore a lock inversion can happen.



 Comments   
Comment by Githook User [ 02/May/23 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-76652 Do not hold CSSLock when constructing PlanExecutor on createRandomCursorExecutor

(cherry picked from commit 1ef91934ee3d8ae22b3b8b51d21a7182b83c13ac)
Branch: v7.0
https://github.com/mongodb/mongo/commit/8cbf0ec019ee2972df1998d686b88df21039b1fd

Comment by Githook User [ 28/Apr/23 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-76652 Do not hold CSSLock when constructing PlanExecutor on createRandomCursorExecutor
Branch: master
https://github.com/mongodb/mongo/commit/1ef91934ee3d8ae22b3b8b51d21a7182b83c13ac

Generated at Thu Feb 08 06:33:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.