Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential fixes for flapping leadership #6951

Closed
wants to merge 2 commits into from
Closed

Commits on Jan 16, 2020

  1. server: prioratize honoring leadership stop event

    This fixes a condition where we may attempt to reconcile and establish
    leadership even after `stopCh` or `shutdownCh` is closed.
    
    Consider the case where a step down occurs during the leaderLoop Barrier
    call and/or it times out.  The Barrier call times out after 2m by
    default, but reconcile interval defaults to 1m.  Thus, both `<-stopCh` and
    `<-interval` clauses are ready in the `WAIT` select statement.  Golang
    may arbitrary chose one, resulting into potentially unnecessary Barrier
    call.
    
    Here, we prioratize honoring `stopCh` and ensure we return early if
    Barrier or reconcilation fails.
    Mahmood Ali committed Jan 16, 2020
    Configuration menu
    Copy the full SHA
    5533586 View commit details
    Browse the repository at this point in the history
  2. nomad: optimize against leadership flapping

    If a non-leader is promoted but then immediately loses leadership, don't
    bother establishing it and attempting Barrier raft transactions
    Mahmood Ali committed Jan 16, 2020
    Configuration menu
    Copy the full SHA
    4d60218 View commit details
    Browse the repository at this point in the history