Xushaohong opened a new pull request #2677:
URL: https://github.com/apache/ozone/pull/2677


   ## What changes were proposed in this pull request?
   Background:
   In a raft based ha cluster, for some reason, we want to transfer leadership 
to a specific follower gracefully, now, we have to kill the leader master to 
transfer leadership, but the leadership could transfer to an unexpected 
follower, we have to kill the leader master again, this is so tricky.
   
   Usage:
   This feature is assumed to utilizing a shell command like ```ozone admin 
failover  [SCM/OM]  [host/host:port/'random'] ```, with optional IpAddr we can 
transfer the leadership to the target follower, with 'random' we can transfer 
leadership to any node except leader node.
   
   
   Changes:
      * the whole procedure is as following
      * Phase1:
      *   server client -> get QuorumInfo from server -> check address whether 
in the quorum
      *
      * Phase2:
      *   raft client -> set priority -> trigger transferLeadership -> old 
leader step down -> new leader take office
     
   P.S.Quorum info includes
   (
     private RaftGroupId raftGroupId;
     private Collection<RaftPeer> peers;
     private String leaderRaftPeerId;
   )
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-5686
   
   Please replace this section with the link to the Apache JIRA)
   
   ## How was this patch tested?
   manual tests. 
   the Integration test will be added soon
   
   Here are some cases shoted
   
   
![demo3](https://user-images.githubusercontent.com/10106574/134800158-b03933f5-7c43-45da-9dd2-ffd3e37203c0.png)
   
![demo2](https://user-images.githubusercontent.com/10106574/134800159-4a7ead4f-cbf5-462c-a79f-30d06bb1cf11.png)
   
![demo1](https://user-images.githubusercontent.com/10106574/134800154-bc4bd2aa-dd81-4074-9a7b-906c68a38de9.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to