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

Call onDrainComplete after checking the node can complete transition to primary

    • Replication
    • Fully Compatible
    • ALL
    • Repl 2024-04-15

      In signalDrainComplete(), we call onDrainComplete() to make the oplog buffer exit drain mode. But this is called before checking canCompleteTransitionToPrimary(). It's possible that this check fails (e.g. when calling signalDrainComplete() with a stale term), and in this case applier should later call signalDrainComplete() for retry.

      Prior to this project this is fine because the batcher will be able to call setTermWhenExhausted for the next batch and then applier call signalDrainComplete() again. But with the changes in project, since the buffer may already exited drain mode, this check will prevent batcher to call setTermWhenExhausted and the node will not complete stepup.

            Assignee:
            wenbin.zhu@mongodb.com Wenbin Zhu
            Reporter:
            wenbin.zhu@mongodb.com Wenbin Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: