|
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.
|