Refactor shard registry initialization

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Sharding EMEA 2022-07-25
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently the ShardRegistry is first constructed, then installed into the Grid and only after it is initialized through ShardRegistry::init].

      All the logic of ShardRegistry::init can be safely performed at construction time, so we can simplify the ShardRegistry startup logic by removing the deferred initialization function.

       

      The creation of the config shard object will initialize the associated RSM monitor that in turns will call ShardRegistry::updateReplSetHosts(). Hence the config shard object MUST be created after the ShardRegistry is fully constructed. This is the reason why we do it inside the init() function instead of inside the ShardRegistry constructor itself.

            Assignee:
            Tommaso Tocci
            Reporter:
            Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: