https://dbaplus.cn/news-141-1875-1.html


zkѡ㷨: LeaderElection/FastLeaderElection/AuthFastLeaderElection
https://blog.csdn.net/u010039929/article/details/70171672

쵼ѡٳ
http://www.uml.org.cn/zjjs/201904191.asp

ѡٵ: 
塢ѡٻ()
5.1 ƣpaxosЭ飩
ȺаϻȺãZookeeperʺϰװ̨
5.2 ڲѡ
ڷֲʽϵͳѡֱӵķֱѡȺһڵΪleaderĽڵΪfollowerһleaderڵҵȺ͹ҵˡҪһ㷨Զѡleaderڵҵfollowerڵѡһڵ㡣
1. ѡٽ׶ Leader election
ZXIDҲǽڵ㱾صţepochͼ֡epochǼԪ˼൱Raft㷨ѡʱtermʶǰleaderڣÿѡһµLeader󣬻һµepoch

нڵ㴦Looking״̬ηͶƱͶƱԼķIDIDZXID
ֱ˵ZXIDԼҲݱԼ£ô·ͶƱͶƱĿǰ֪ZXIDڵ㡣
ÿͶƱ󣬷ͳͶƱжǷĳڵõϵͶƱĽڵ㣬ýڵ㽫Ϊ׼Leader״̬ΪLeadingڵ״̬ΪFollowing

2. ֽ׶ Discovery

Ϊ˷ֹĳЩԭһ׶βLeader
Leader˼棬FollowerԵepochֵLeaderѡepochڴֵ1µepochַFollower
Followerյȫµepoch󣬷ACKLeaderϸZXIDʷ־LeaderѡZXIDʷ־

3. ͬ׶ Synchronization
Leaderղռõʷ־ͬȺеFollowerֻеFollowerͬɹ׼LeaderܳΪʽLeader
