-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
Replication
-
Fully Compatible
-
ALL
This report comes mostly from code inspection. When chaining is not allowed in replication, ReplSetImpl::getMemberToSyncTo only allows a secondary to sync from the primary. If a primary cannot be reached, syncing does not happen.
In consensus.cpp, an election will refuse to elect a member with a lower priority if a member with a higher priority exists and is within 10 seconds of being caught up.
These two facts together can cause a replica set to never elect a primary.
Take the following scenario. Chaining is disabled, and no primary exists. Member A has priority 10 (the highest in the set), and is 5 seconds behind member B that has priority 1. B is furthest along. Neither A nor B will ever be elected. B won't be elected because the election algorithm will say "A is within 10 seconds and has a higher priority". A won't get elected because it is behind B, and because chaining is disallowed, cannot replicate from B to catch up.
I think the end result is a primary never gets elected.
I don't see any code that says "ignore the chainingAllowed bit and replicate off a secondary because a primary does not exist".
- is duplicated by
-
SERVER-19118 Always allow replica to replicate from non-primary when necessary
- Closed