[SERVER-20040] Holders of a ForwardingCatalogManager::ScopedDistLock should not call other methods on ForwardingCatalogManager Created: 19/Aug/15  Updated: 25/Jan/17  Resolved: 02/Sep/15

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

Type: Task Priority: Major - P3
Reporter: Andy Schwerin Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 9 (09/18/15)
Participants:

 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.



 Comments   
Comment by Githook User [ 02/Sep/15 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-20040 fassert that we never hold a distributed lock while waiting for the CatalogManager to swap
Branch: master
https://github.com/mongodb/mongo/commit/f5aa3dabe8e7a9cbc35a2af2286b4165a00cd17a

Comment by Githook User [ 02/Sep/15 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-20040 Don't call methods on ForwardingCatalogManager while holding a distlock
Branch: master
https://github.com/mongodb/mongo/commit/a4437cd57009e209b1944613a163511574ad6343

Comment by Githook User [ 02/Sep/15 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-20040 Access the ForwardingCatalogManager explicitly when needed, otherwise use the CatalogManager interface
Branch: master
https://github.com/mongodb/mongo/commit/0b658fdc266a13a042a31ab2a46182dac838459a

Generated at Thu Feb 08 03:52:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.