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

Update faulty invariant in TopologyCoordinatorImpl::completeTransitionToPrimary

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0-rc2
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Repl 2017-10-23, Repl 2017-11-13
    • 0

      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.

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: