-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cannot force allocate primary to a node where the shard already exists (
#22031) Before, it was possible that the SameShardAllocationDecider would allow force allocation of an unassigned primary to the same node on which an active replica is assigned. This could only happen with shadow replica indices, because when a shadow replica primary fails, the replica gets promoted to primary but in the INITIALIZED state, not in the STARTED state (because the engine has specific reinitialization that must take place in the case of shadow replicas). Therefore, if the now promoted primary that is initializing fails also, the primary will be in the unassigned state, because replica to primary promotion only happens when the failed shard was in the started state. The now unassigned primary shard will go through the allocation deciders, where the SameShardsAllocationDecider would return a NO decision, but would still permit force allocation on the primary if all deciders returned NO. This commit implements canForceAllocatePrimary on the SameShardAllocationDecider, which ensures that a primary cannot be force allocated to the same node on which an active replica already exists.
- Loading branch information
Ali Beyad
authored
Dec 8, 2016
1 parent
8fe4bc1
commit 3da0429
Showing
2 changed files
with
86 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters