Introduction to kafka, Leader and Follower fault handling details (14)

Leader and Follower Troubleshooting Details

LEO: the last offset of each abdomen, leo is actually the latest offset+1
HW: the smallest LEO among all copies

Follower Troubleshooting Details

insert image description here
(1) If a follower fails, the ISR will be temporarily raised
(2) During this period, the leader and the follower will save and receive data
(3) After the follower recovers, the follower will read the last HW recorded on the local disk and make the log file higher than the HW Partial interception, starting from the HW to synchronize with the leader
(4) Wait until the follower's LEO is greater than or equal to the Partition's HW, that is, after the follower catches up with the leader, it can rejoin the ISR

Leader fault handling details

insert image description here
(1) After the Leader fails, a new leader will be selected from the ISR
(2) To ensure data consistency between multiple copies, the rest of the Followers will first cut off the part of their log files higher than the HW , and then synchronize data from the new leader
注意:这只能保证副本之间的数据一致性,并不能保证数据不丢失或不重复

Guess you like

Origin blog.csdn.net/weixin_43205308/article/details/131488252