We are vulnerable to reach to this Invariant following this scenario:
1- A follower node called for a dry run election due to catchup takeover and sent primaryIndex to voteRequester to start scatter_and_gather_runner to send voteRequests to all voters.
2- All Requests has been scheduled with processResponse as callbacks
3- Primary node's response is the last response to be processed, which indicates that _callbacks list is empty.
4- The request to the Primary Node failed so we end-up with failed response and we return leaving _primaryVote unchanged as PrimaryVote::Pending.
5- So the call to hasReceivedSufficientResponses will return false causing the Invariant to fire.
Ask to add more diagnostic information:
Can we add primaryIndex to that log line to log what is the last known primaryIndex for this node while running for the dry-run catchup takeover.