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

Update faulty invariant in TopologyCoordinatorImpl::completeTransitionToPrimary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-rc2
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Repl 2017-10-23, Repl 2017-11-13
    • Linked BF Score:
      0

      Description

      When exiting drain mode, we check that we are in the proper state to complete our transition to primary after taking the global X lock. After that check, we release the repl coord mutex, write our on election oplog entry, reacquire the repl coord mutex, then complete our transition to primary.

      In TopologyCoordinatorImpl::completeTransitionToPrimary, we invariant that we still are in in leaderElect mode or in a stepdown attempt. We can also, however, be the leader mode for an unconditional stepdown, as we might have heard of a higher term while we had the repl coord mutex unlocked. In this case the proper thing to do is complete our transition to primary (since we've already logged the transition to primary oplog entry), then immediately step down.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: