As the leader, after receipt of the legal number of followers ACKs is broadcast to all the followers COMMIT command, at the same time, it can be carried in the local COMMIT and returned to the connection of the client (success), but if in each follower leader before receiving the COMMIT command will hang up and lead to the rest of the server did not perform this message,
How do you solve a transaction request has been processing (proposal) (commit) can't throw?
1, elections have maximum proposal (namely zxid maximum) of nodes as a new leader: because all proposals have been COMMIT must have a legitimate number of followers before an ACK, namely must have a legitimate number of server transaction log on a proposal for this proposal is, therefore, latest zxid is the largest data node to keep all the proposal by the COMMIT message status,
2, the new leader will own proposal in the transaction log but he didn't COMMIT the message processing,
3, the new leader and the follower to establish a fifo queue, will own the followers not proposal first sent to the follower, then the proposal of the COMMIT command sent to the follower, to ensure that all the followers to save all of the proposal, all followers to deal with all of the messages,
My question is: if the proposal from the old leader was less than half of the followers received hang up and then elected a new leader for the largest ZXID should be contain those who have not been submitted proposal, but the proposal has not been actually old leader submitted, the agreement is how to deal with this scenario?
CodePudding user response:
New leader will be in the recovery phase will ask if there is more than half of the flower received the proposal according to your scene, received no more than half of the flower, the new leader will give up this proposal will not be submittedCodePudding user response:
Specific process can refer to this blog https://blog.csdn.net/gangsijay888/article/details/82383599 half part of [the] several leadership election scene analysis, analysis is very comprehensiveCodePudding user response: