-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
None
-
None
-
None
-
None
-
None
-
None
-
None
During ShardingInitializationMongoD's onStepUpComplete, we create a lot of indexes on sharding metadata collections. These index builds, both the shard server and the config server ones, have an early exit if the index builds hit a not primary or a shutdown error.
This behavior seems a bit concerning because it seems as though onStepUpComplete would return success before having done all of it's work without any clear mechanism ensuring that the step up to primary does not continue.
Additionally, some of this handling seems to be inconsistent and/or not obviously related to the caller. For example, here we only check for Shutdown, not for NotPrimary and here, we ignore errors in a called function but if that function were to change, this would break (assuming the early return is the required behavior).
We should investigate if these early returns are safe and necessary. If not, we should remove them. If so, we should unify this handling so that the behavior is clear.
- is related to
-
SERVER-30714 Handle step down error in ReplicationCoordinatorExternalStateImpl::_shardingOnTransitionToPrimaryHook
-
- Closed
-