-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Fully Compatible
-
v4.4
-
Repl 2020-04-06
Consider a secondary Node 0 syncing from a member, Node 1.
When Node 0 executes TopologyCoordinator::shouldChangeSyncSource, it checks whether Node 1 thinks the primary has changed. Node 0 uses unsafe logic for this purpose: it checks the OplogQueryMetadata.currentPrimaryIndex it received from Node 1, but Node 0 doesn't know if it has the same config as Node 1 or not, so it doesn't know what member currentPrimaryIndex refers to.
Fortunately, all that Node 0 needs to know when it executes TopologyCoordinator::shouldChangeSyncSource is whether Node 1 itself is the primary. Add an isPrimary field to ReplSetMetadata, and deprecate currentPrimaryIndex.
Before closing this ticket, open another ticket to remove OplogQueryMetadata.currentPrimaryIndex in the next release.
(Discovered during the SERVER-46667 investigation.)
- depends on
-
SERVER-46120 Error if a batch doesn't have metadata in the oplog fetcher
- Closed
- is related to
-
SERVER-44939 Allow data replication across config versions
- Closed
-
SERVER-46667 Avoid invariant from invalid candidateIndex
- Closed
- related to
-
SERVER-47125 Require ReplSetMetadata.isPrimary, remove OplogQueryMetadata.primaryIndex
- Closed