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

Report ismaster:false in isMaster command response immediately upon learning of a new term

    • Fully Compatible
    • v4.0, v3.6
    • Repl 2018-12-17
    • 18

      Currently when a primary hears of a new term, it schedules work to take the global X lock and step down. Actually preventing new writes from being accepted requires changing the value of ReplicationCoordinatorImpl::_canAcceptNonLocalWrites, which requires the global X lock, so there's no way to stop accepting new writes any faster than we do currently. Filling out the response to an isMaster command, however, only requires the repl coord mutex, so we could be reporting ismaster:false as soon as we hear about a new term since at that point we know that we definitely are going to step down. This could stop new writes from being routed to us that are doomed to fail once the stepdown completes.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: