Xushaohong opened a new pull request, #4128: URL: https://github.com/apache/ozone/pull/4128
## 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: (Take om for example) <img width="1030" alt="2" src="https://user-images.githubusercontent.com/10106574/209518844-96a112f0-c40b-4ab8-ac10-9871822b84c1.png"> We will have three optional ways to transfer the leadership. 1. Use nodeId (will be converted to host format with configuration) 2. Use host in IP:PORT format (Ratis port) 3. Use -r random flag to quickly transfer the leadership Based on some discussion, this feature is necessary now and should be done in the Ozone way instead of integrating with the Ratis shell. This is the reason I refined it and adopted many suggestions from the old PR.https://github.com/apache/ozone/pull/2686 1. Separate the transfer command as a subcommand under both ozone admin om and ozone admin scm. 2. Move the logic from the client side to server side, which makes the commond more safe like others and hence removes the direct talk to raft server. Also, this could be more common that every client can have this ability. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-5686 ## How was this patch tested? Manual test. <img width="825" alt="6" src="https://user-images.githubusercontent.com/10106574/209520732-e7035399-dd37-413d-9a5d-200b478c5ae1.png"> <img width="916" alt="8" src="https://user-images.githubusercontent.com/10106574/209520750-e060fa88-a904-4a53-aac5-291e7f57facb.png"> Besides, I have tested with OCKG load to see if workload delays the progress of transferring leadership. The result infers not. The average time consumption for this shell is round 7s. Sometimes, it takes 9 seconds around. <img width="355" alt="image" src="https://user-images.githubusercontent.com/10106574/209521313-fd453b04-ef05-4b58-92be-9aaad93b822d.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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
