-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
Labels:None
-
Fully Compatible
-
ALL
-
RPL 7 08/10/15
When one-node replica sets go right to state Primary, it wasn't choosing the correct startup term. We can restore the startup term from the last entry in oplog and the last vote document, whichever is greater.
The term in the last oplog entry guarantees that the terms in oplog never go backwards. The last vote's term guarantees that a stale primary won't commit an operation on the majority once a new primary wins an election, even if some nodes (including voters of the new primary) restart at the meantime. Terms on the minority secondaries that didn't participate the last vote may go backwards for a short time after a restart, but it should be harmless.
Curren term should always be greater than or equal to the term of its last vote.
- related to
-
SERVER-19704 Store the current term in persistent storage
- Closed