[SERVER-83997] Add awareness of assigned ClusterRoles to ServiceContextTest Created: 07/Dec/23  Updated: 29/Jan/24

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: James Bronsted Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: pm-635-milestone-3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-85770 Enable internal routing capabilities ... Open
Related
is related to SERVER-82588 Move CatalogCacheLoader to be a decor... Closed
Assigned Teams:
Service Arch
Participants:

 Description   

Currently, `ShardingTestFixture` isn't able to become aware of the `ClusterRole`s that are assigned to it. By default, it is assigned only `ClusterRole::ShardServer`. In some cases, however, a particular test fixture will inherit from `RouterRoleOverride`, which assigns `ClusterRole::RouterServer` and then from `ShardingTestFixture`. At the time of writing, the following fixtures follow this pattern:

In these cases, only `ClusterRole::RouterServer` is set. As a result, it's difficult to make a judgment call for which `Service` to assign the `CatalogCacheLoader` to in the `ShardingTestFixture` constructor, and more generally, it's difficult to reason about what `ClusterRole`s a `ShardingTestFixture` might be assigned (or any subclass of `ServiceContextTest` for that matter).

Add support for discovering the `ClusterRole`s that are set for tests that inherit from `ServiceContextTest` and the role override classes. Implementation will likely require reinstrumenting the way that the role override classes are inherited from (george.wangensteen@mongodb.com has suggested using CRTP). Once support is in place, remove the TODO in `ShardingTestFixture` and explicitly discover the correct `ClusterRole` to associate the `CatalogCacheLoader` with.


Generated at Thu Feb 08 06:53:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.