-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Replication
-
Labels:None
-
Replication
Consider a 3 nodes replica set. B is primary and A and C are syncing from B. A is at optime (1,1), B is at optime (5,1), C is at optime (3,1). If there is a network partition between B and C, C will run for election, A will vote for it, C will win its election, and it will write (4,2). Eventually B will time out and step down. A does not stop syncing from B when B steps down, and will replicate all the way to (5,1). When the partition lifts, or A catches up, they will both start syncing from C and go into rollback. B is no longer a primary when A catches up, and A propagates C's term, so there’s no danger of committing writes that will roll back. This is probably not ideal though since A did not need to roll back, and A should probably switch sync sources much sooner.