Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-1247 Support rolling upgrade and rollback
  3. RATIS-1762

Support transfer leadership between nodes with same priority

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • None
    • None

    Description

      Current transfer leadership implementation in Ratis is depending on priority. The current leader will periodically check follower's priority, and yield leader to higher priority peer.

      In this Jira, I propose to implement the basic transfer leadership operation, which is described in section 3.10 "leadership transfer extension" of Diego Ongaro's PhD dissertation. In a future Jira, we can change the current "yieldLeaderToHigherPriorityPeer()" to use this operation.

      Steps of the transfer leadership operation:

      1. The prior leader stops accepting new client requests.
      2. The prior leader fully updates the target server’s log to match its own, using the normal log replication mechanism.
      3. The prior leader sends a TimeoutNow request to the target server. This request has the same effect as the target server’s election timer firing: the target server starts a new election (incrementing its term and becoming a candidate).

      Success condition:

      • Once the target server receives the TimeoutNow request, it is highly likely to start an election before any other server and become leader in the next term. Its next message to the prior leader will include its new term number, causing the prior leader to step down. At this point, leadership transfer is complete.

      Failure condition:

      • It is also possible for the target server to fail; in this case, the cluster must resume client operations. If leadership transfer does not complete after about an election timeout, the prior leader aborts the transfer and resumes accepting client requests. If the prior leader was mistaken and the target server is actually operational, then at worst this mistake will result in an extra election, after which client operations will be restored.

      Attachments

        Issue Links

          Activity

            People

              ckj Kaijie Chen
              ckj Kaijie Chen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h
                  3h