简体   繁体   中英

what is a role of leader epoch checkpoint in log segment of Kafka partition?

what is a role of leader epoch checkpoint in log segment of Kafka partition?

文件夹捕获图像

In Kafka, a leader epoch refers to the number of leaders previously assigned by the controller. Every time a leader fails, the controller selects the new leader, increments the current "leader epoch" by 1, and shares the leader epoch with all replicas. The replicas use the leader epoch as a means of verifying the current leader. If a leader fails and returns, when it tries to contact other replicas, it will send what it believes is the current leader epoch . The replicas will ignore the messages sent with outdated leader epochs .

The leader-epoch-checkpoint file contains two columns: epochs and offsets, as shown here . Each row is a checkpoint for the latest recorded leader epoch and the leader's latest offset upon becoming leader. Both replicas and leaders contain this file. Its role is for checking what range of offsets pertain to which epoch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM