[SERVER-68137] Refactor shard registry initialization Created: 19/Jul/22  Updated: 29/Oct/23  Resolved: 22/Jul/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Tommaso Tocci
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2022-07-25
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 21/Jul/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-68137 Refactor shard registry initialization
Branch: master
https://github.com/mongodb/mongo/commit/db1d7025074076abf55c47319a0f6c0898f2d605

Comment by Githook User [ 21/Jul/22 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-68137 Refactor shard registry initialization
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/07b8381f0873947be916ae5b662bf6e3442a6a57

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