|
Currently mongod with an embedded router opts-out of the call to initializeGlobalShardingState in _initializeShardingEnvironmentOnShardServer because, like the config-shard, on ordinary startup it sets up global sharding state like the Grid _before receiving any shard identity document insertion.
However, if a shard identity doc is already present on startup, we will try and initialize global sharding awareness on mongod before this, so the opt-out is not correct in this case.
We should order the initialization so that it is safe to be an embedded router node regardless of whether or not a shard identity document is present on startup.
|