[SERVER-35938] NamespaceSerializer lock should be used for database as well as collection during createCollection Created: 02/Jul/18  Updated: 29/Oct/23  Resolved: 09/Jul/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.0.1, 4.1.1

Type: Bug Priority: Major - P3
Reporter: Matthew Saltz (Inactive) Assignee: Janna Golden
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-49145 Prevent distributed lock timeouts in ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Sharding 2018-07-16
Participants:
Linked BF Score: 17

 Description   

In ConfigSvrCreateCollectionCommand here here we use the NamespaceSerializer for the collection lock, but not the database lock. Since we also need to take the distlock for the database, we should also use the NamespaceSerializer for that too. Otherwise we end up with timeouts in situations with high concurrency.



 Comments   
Comment by Githook User [ 11/Jul/18 ]

Author:

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

Message: SERVER-35938 Take scoped NamespaceSerializer lock on db for createCollection

(cherry picked from commit 53be2bca4962b281e7b1cc17742d8c857a338aa4)
Branch: v4.0
https://github.com/mongodb/mongo/commit/f7a959de65838a661540bd5089b6650d2d102aeb

Comment by Githook User [ 09/Jul/18 ]

Author:

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

Message: SERVER-35938 Take scoped NamespaceSerializer lock on db for createCollection
Branch: master
https://github.com/mongodb/mongo/commit/53be2bca4962b281e7b1cc17742d8c857a338aa4

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