Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-62919

Change CollectionLock to use TenantNamespaceOrUUID

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Serverless

    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.

      Attachments

        Activity

          People

            backlog-server-serverless [DO NOT USE] Backlog - Server Serverless (Inactive)
            janna.golden@mongodb.com Janna Golden
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: