[SERVER-62919] Change CollectionLock to use TenantNamespaceOrUUID Created: 24/Jan/22  Updated: 06/Dec/22  Resolved: 06/Apr/22

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

Type: Task Priority: Major - P3
Reporter: Janna Golden Assignee: [DO NOT USE] Backlog - Server Serverless (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-62812 Add TenantNamespaceOrUUID type Closed
depends on SERVER-62916 Change CollectionCatalog::resolveName... Closed
Assigned Teams:
Serverless
Participants:

 Description   

Similar to DBLock, CollectionLock takes in NamespaceStringOrUUID and then passes a string to the ResourceId constructor. We should change the CollectionLock constructor to take in TenantNamespaceOrUUID, and then use TenantNamespace string to pass to the ResourceId constructor. We may want to consider adding a function TenantNamespace::getTenantDatabaseName() - that way we can use it in places where we, for example, check that the DB is locked before locking the collection (i.e. like here). Then, again similar to the changes we made for DBLock, let's change Locker::isCollectionLockedForMode to take in TenantNamespaceOrUUID as well.

CollectionLock is also unit tested by DConcurrencyTestFixture - we'll again need to change the existing tests to use TenantNamespaceOrUUID, and should add a test case to check that we can take a CollectionLock on two databases with the same NamespaceString, but different tenantIds.


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