Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-37255

replSetReconfig with concurrent election can trigger invariant

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.6.11, 4.0.7, 4.1.6
    • Fix Version/s: 3.6.12, 4.0.8, 4.1.7
    • Component/s: Replication
    • Labels:
    • Operating System:
      ALL
    • Backport Requested:
      v4.0, v3.6, v3.4
    • Sprint:
      Repl 2018-10-22, Repl 2018-11-05, Repl 2019-01-14
    • Linked BF Score:
      52

      Description

      If a replSetReconfig runs on a node that is concurrently processing a successful election win, it is possible to trigger this invariant. The ReplicationCoordinatorImpl::_onVoteRequestComplete method is called when the VoteRequester completes. In the case of a successful election, we will print this message, and then proceed to processing the election win. We will reset the VoteRequester and then update our member state to reflect our transition to leader. Before we call _performPostMemberStateUpdateAction, though, we unlock the ReplicationCoordinator mutex. This allows a concurrent reconfig command, currently running ReplicationCoordinatorImpl::_finishReplSetReconfig, to end up cancelling an election before we have transitioned to Leader mode. We call ReplicationCoordinatorImpl::_cancelElectionIfNeeded_inlock when the _voteRequester has been reset, but while we are still in the Candidate role. So, we will not return early here, and will end up hitting the subsequent invariant, since the VoteRequester was already destroyed.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: