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

    XMLWordPrintable

    Details

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: