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

Refactor stepDown to wait for majority and electable nodes more precisely

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Replication

      Currently, stepDown uses
      ThreadWaiter and WaiterGuard always keeps the waiter in the list as long as the WaiterGuard is in scope. The function's implementation is a bit confusing at the moment. What it really needs to do is to wait for majority with at least one electable node. The implementation now keeps the majority waiter in the list even though majority is satisfied, only because it wants to use the waiter list notification as an indicator of oplog changes so it can check if the majority nodes that the write has replicated to contains at least one electable node. If no, it goes back into waiting until another node's OpTime changes then re-check again to avoid polling.

      Ideally, this should wait for majority then $stepDownCheck. Or somehow combine the two rules into one.

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: