[SERVER-43859] Use only MODE_IX locks for creating a new collection, and new db if needed Created: 07/Oct/19  Updated: 29/Oct/23  Resolved: 26/Nov/19

Status: Closed
Project: Core Server
Component/s: Catalog, Concurrency
Affects Version/s: None
Fix Version/s: 4.3.3

Type: New Feature Priority: Major - P3
Reporter: Geert Bosch Assignee: Daniel Gottlieb (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-44276 Have the storage engine catalog cache... Closed
Backwards Compatibility: Minor Change
Sprint: Execution Team 2019-10-21, Execution Team 2019-11-04, Execution Team 2019-11-18, Execution Team 2019-12-02
Participants:
Linked BF Score: 15

 Comments   
Comment by Githook User [ 26/Nov/19 ]

Author:

{'name': 'Daniel Gottlieb', 'username': 'dgottlieb', 'email': 'daniel.gottlieb@mongodb.com'}

Message: SERVER-43859: Take MODE_IX locks for collection creation.

Two concurrent storage transactions can now create collections with the same
collection name. These transactions will conflict at commit time; the first
committer will win and register their collection into the global catalog. The
losing transactions will bubble a WriteConflictException.

Top-level callers that should fail if the collection already existed must now
check and fail with a NamespaceExists error code. Previously, those callers
could rely on lower level code returning the NamespaceExists error.

Callers that were implicitly creating a collection may retry the operation,
using the now-registered collection.

These transaction-local collections (UncommittedCollections) are returned when
doing any CollectionCatalog::lookup* call.
Branch: master
https://github.com/mongodb/mongo/commit/d471957fc37ef6cafe9ffeda3e231cdc871c3ce3

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