-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
Labels:
-
Fully Compatible
-
Sharding 2020-07-13, Sharding 2020-06-29
This ticket has two parts:
- Create a new MigratingTenantAccessBlockerByPrefix class that is a decoration on ServiceContext (see example). The class should go in a new migrating_tenant_access_blocker_by_prefix{.h, .cpp} file and be linked in to the serveronly_repl library. The class should contain a StringMap from database prefix to shared_ptr<MigratingTenantAccessBlocker> and have a member mutex to synchronize access to the StringMap (see example). The class should have the following methods:
- add(StringData dbPrefix, shared_ptr<MigratingTenantAccessBlocker> mtab)
- remove(StringData dbPrefix)
- shared_ptr<MigratingTenantAccessBlocker> get(StringData dbName)
- void appendInfoForServerStatus(BSONObjBuilder* builder).
- Add a ServerStatusSection for the MigratingTenantAccessBlockerByPrefix class in a new migrating_tenant_access_blocker_server_status_section.cpp file that is linked in to the serveronly_repl library. The ServerStatusSection::generateSection should call MigratingTenantAccessBlockerByPrefix::appendInfoForServerStatus (see example). The actual serverStatus output may change a bit, but for now let's just expose the state in each MigratingTenantAccessBlocker by adding a MigratingTenantAccessBlocker::appendInfoForServerStatus that appends the '_access' variable, _blockTimestamp (if set) and _commitOrAbortOpTime (if set).
Manually test that the info about MigratingTenantAccessBlockerByPrefix appears in serverStatus output. You can do this by calling MigratingTenantAccessBlockerByPrefix::add somewhere in mongod startup, e.g. here.