[SERVER-78868] Investigate removal of locking in SBE PlanExecutor Created: 11/Jul/23  Updated: 17/Nov/23  Resolved: 17/Nov/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Task Priority: Major - P3
Reporter: Jordi Olivares Provencio Assignee: Projjal Chanda
Resolution: Fixed Votes: 0
Labels: quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Sprint: QE 2023-11-13, QE 2023-11-27
Participants:

 Description   

Inside PlanExecutorSBE::getNextImpl there is currently a call to AutoGetCollection.

If the lock has been acquired before for lock-free reads and we do not have the PBWM lock this call will acquire it. The acquisition in this case would be out of order and can lead to deadlocks.



 Comments   
Comment by Githook User [ 17/Nov/23 ]

Author:

{'name': 'Projjal Chanda', 'email': 'projjal.chanda@mongodb.com', 'username': 'projjal'}

Message: SERVER-78868: Remove locking in sbe plan executor
Branch: master
https://github.com/mongodb/mongo/commit/47223c44caded8a274ab4025f2937fcfaa99b46c

Comment by Projjal Chanda [ 06/Nov/23 ]

When this AutoGetCollection was added, the locks were held at the leaf stage in scan nodes in SBE. This is no longer true since the lock acquisition is done at a higher level so it can be removed now.

Comment by Jordi Olivares Provencio [ 08/Sep/23 ]

kyle.suarez@mongodb.com I'd say the deadlock cannot happen, but there's still some value in understanding why we instantiate an AutoGetCollection that's not used anywhere.

Particularly as we want to move towards the shard role API and deprecate AutoGetCollection usages.

Comment by Kyle Suarez [ 08/Sep/23 ]

jordi.olivares-provencio@mongodb.com, the PBWM lock has been removed. Is this ticket still relevant?

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