Introduction to zab protocol

The ZAB protocol contains two basic modes, namely

1. Crash Recovery

2. Atomic Broadcast

When the entire cluster is started, or when the leader node has a network interruption, crash, etc., the ZAB protocol will enter the recovery mode and elect a new leader. When the leader server is elected, and there are more than half of the machines in the cluster. After the leader node completes data synchronization (synchronization refers to data synchronization, which is used to ensure that more than half of the machines in the cluster can
maintain the same data status as the leader server ), the ZAB protocol will exit the recovery mode.

When more than half of the follower nodes in the cluster have completed synchronization with the leader state, the entire cluster enters the message broadcast mode. At this time, when the leader node is working normally, start a new server to join the cluster, then the server will directly enter the data recovery mode and synchronize data with the leader node. After the synchronization is completed, the processing of non-transaction requests can be provided to the outside normally.

It should be noted that the leader node can handle transaction requests and non-transaction requests, and the follower node can only handle non-transaction requests. If the follower node receives a non-transaction request, it will forward the request to the Leader server

 

Guess you like

Origin blog.csdn.net/Leon_Jinhai_Sun/article/details/112853647