-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Fully Compatible
-
ALL
-
v5.0
-
Repl 2021-06-28
-
(copied to CRM)
We currently initiate catchup takeover when we get a heartbeat, no election is occurring and the primary's optime is behind a secondary node's optime. In a chaining situation, the primary's optime could be staler than our own optime because we're receiving writes through a different path (OplogFetcher), and not updating the primary's optime based on it. This will cause us to initiate catchup takeover, and immediately cancel it when we realize another secondary is ahead of us, as in HELP-24655
I believe that we are potentially in a catchup situation only when our last applied optime's term is less than our election term; if it is the same, that means the current primary has successfully caught up. Checking this would avoid scheduling and canceling catchup takeover.