[SERVER-49172] Create MigratingTenantAccessBlockerByPrefix class and expose it through serverStatus Created: 29/Jun/20  Updated: 29/Oct/23  Resolved: 08/Jul/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Task Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Luis Osta (Inactive)
Resolution: Fixed Votes: 0
Labels: pm-1791_milestone-A
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-07-13, Sharding 2020-06-29
Participants:

 Description   

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.

 



 Comments   
Comment by Githook User [ 08/Jul/20 ]

Author:

{'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}

Message: SERVER-49172 Create MigratingTenantAccessBlockerByPrefix class and expose it through serverStatus
Branch: master
https://github.com/mongodb/mongo/commit/0b1eab6caebf276b9d73ea7126b74efab813fc51

Generated at Thu Feb 08 05:19:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.