[SERVER-73212] Remove collection locks from sharding index catalog observers Created: 23/Jan/23  Updated: 29/Oct/23  Resolved: 06/Feb/23

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

Type: Task Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: PM-2583-Milestone-3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-73184 Ensure collection locks are taken in ... Closed
Problem/Incident
Related
is related to SERVER-74247 Don't take global lock in UserWriteBl... Open
is related to SERVER-74249 Don't take DB lock in ShardServerOpOb... Backlog
Assigned Teams:
Sharding EMEA
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2023-02-06
Participants:
Linked BF Score: 151

 Description   

Currently in the sharding's op observer when handling sharding's index catalog we're holding collection locks inside the onCommit's handler, this could cause the following behavior: if the OperationContext is interrupted, then attempting to acquire a lock would throw an exception and lead to a server crash because onCommit() handlers are noexcept.

We should move the collection acquiring, like for example, to the sharding index catalog ddl util inside each writeConflictRetry in resource id order.



 Comments   
Comment by Githook User [ 06/Feb/23 ]

Author:

{'name': 'Marcos José Grillo Ramirez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-73212 Remove collection locks on sharding index catalog shard observer's onCommit handlers
Branch: master
https://github.com/mongodb/mongo/commit/647bfee7a2e21b6589a01dd707a9a540d60c20fe

Comment by Githook User [ 02/Feb/23 ]

Author:

{'name': 'Sviatlana Zuiko', 'email': 'sviatlana.zuiko@mongodb.com', 'username': 'szuiko'}

Message: Revert "SERVER-73212 Remove collection locks on sharding index catalog shard observer's onCommit handlers"

This reverts commit d03e958969f89a1cfacf0465abaa8d1705c2de7d.
Branch: master
https://github.com/mongodb/mongo/commit/d29c2f977931910d20a667ac4cd7eb872f134b07

Comment by Githook User [ 01/Feb/23 ]

Author:

{'name': 'Marcos José Grillo Ramirez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-73212 Remove collection locks on sharding index catalog shard observer's onCommit handlers
Branch: master
https://github.com/mongodb/mongo/commit/d03e958969f89a1cfacf0465abaa8d1705c2de7d

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