Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-46201

Implement a generic ReplicaSetStateAwareService

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.0
    • Component/s: Sharding
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Sharding 2020-03-23, Sharding 2020-04-06

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kevin.pulo Kevin Pulo
              Reporter:
              kaloian.manassiev Kaloian Manassiev
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: