[SERVER-72898] Investigate if updateShardIdentityConfigString can use MODE_IX lock Created: 17/Jan/23  Updated: 29/Oct/23  Resolved: 05/Apr/23

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

Type: Improvement Priority: Major - P3
Reporter: Jordi Olivares Provencio Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-71198 Assert that unkillable operations tha... Backlog
Assigned Teams:
Sharding EMEA
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2023-04-17
Participants:

 Description   

As part of SERVER-71198 we found that ShardingInitializationMongoD::updateShardIdentityConfigString is taking a database MODE_X lock and then replacing a single document in a collection underneath it without holding any collection locks.{{{}
{}}}

Ideally in this situation we should only acquire a MODE_IX lock using AutoGetCollection for the target collection as we already provide document-level locking with WiredTiger. This would avoid the unnecessary strong lock on the database.



 Comments   
Comment by Githook User [ 05/Apr/23 ]

Author:

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

Message: SERVER-72898 Use AutoGetCollection MODE_IX on updateShardIdentityConfigString
Branch: master
https://github.com/mongodb/mongo/commit/adc44e57c94aab48ee8263d6efbc69c98c8a6e47

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