[SERVER-46201] Implement a generic ReplicaSetStateAwareService Created: 15/Feb/20  Updated: 29/Oct/23  Resolved: 26/Mar/20

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

Type: Task Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kevin Pulo
Resolution: Fixed Votes: 0
Labels: PM-1645-Milestone-3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-46200 Implement a VectorClockService Closed
Related
is related to SERVER-47582 Stepdown in drain mode can trigger de... Closed
is related to SERVER-50002 ReplicaSetAwareService test should ju... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-03-23, Sharding 2020-04-06
Participants:

 Description   

Currently there is a lot of duplication of code to initialise and change the state of internal services as the state of replication changes. Just a few examples of this are the ShardServerCatalogCacheLoader, ClusterIdentityLoader and the Balancer.

Instead of having everything in the ReplicationCoordinatorExternalState, this ticket proposes to have a global registry of replication-aware services (where global means for a single MongoD process), on which developers can register their service implementations. The service implementations will override a strict set of virtual functions corresponding to the state transitions of the replica set. These state transitions will have pre-defined rules of what locks are held, what can be done under them (for example no blocking I/O during step-down), etc.

The interface of the registry should be similar to ServiceContext::ConstructorActionRegisterer so that services are automatically registered as the node starts-up.

As part of this ticket, at least one service (perhaps the Sharding Balancer) should be converted to use this framework.



 Comments   
Comment by Githook User [ 26/Mar/20 ]

Author:

{'name': 'Kevin Pulo', 'username': 'devkev', 'email': 'kevin.pulo@mongodb.com'}

Message: SERVER-46201 small missed tweaks to ReplicaSetAwareService
Branch: master
https://github.com/mongodb/mongo/commit/863f07b9c9ee3749950b60f4b9ff598d1227a057

Comment by Githook User [ 24/Mar/20 ]

Author:

{'name': 'Kevin Pulo', 'username': 'devkev', 'email': 'kevin.pulo@mongodb.com'}

Message: SERVER-46201 add ReplicaSetAwareService, convert Balancer to use it
Branch: master
https://github.com/mongodb/mongo/commit/c1f3e2fca052039dd5ce1cea2fa4c3d4565cfe6c

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