Details
Description
Rather than call methods on ForwardingCatalogManager, holders of ForwardingCatalogManager::ScopedDistributedLock that need access to a catalog manager should get a pointer to the correct actual catalog manager by calling a method on their instance of ScopedDistributedLock.
Because the FCM::SCD suppresses switching of the actual catalog manager underneath the ForwardingCatalogManager, it is unnecessary to engage FCM's locking and replacement detection. Furthermore, because the FCM::SCD is in scope, another operation on the FCM by the thread holding the FCM::SCD might block indefinitely waiting for the catalog manager to be replaced.
This approach will cause operations that hold a ScopedDistributedLock, such as chunk migrations, to fail if the catalog manager needs to be replaced due to upgrade mid migration.