-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use confirmed term as a source of leader epoch #16560
Use confirmed term as a source of leader epoch #16560
Conversation
A confirmed term is used to determine if the state of a replica is up to date after the leader election. Only after the confirmed term is equal to the current term one can reason about the Raft group state. On the leader the confirmed term is updated after first successful replication of a batch subsequent to a leader election. After the replication succeed leader is guaranteed to have up to date committed and visible offsets. On the follower the confirmed term is updated only when an append entries request from the current leader may be accepted and follower may return success. Signed-off-by: Michal Maslanka <michal@redpanda.com>
A leader epoch is used by Kafka clients to determine if a replica is up to date with the leader and to detect truncation. The leader epoch differs from Raft term as the term is updated when leader election starts. Whereas the leader epoch is updated after the state of the replica is determined. Therefore the leader epoch uses confirmed term instead of the simple term which is incremented every time the leader election starts. Signed-off-by: Michal Maslanka <michal@redpanda.com>
new failures in https://buildkite.com/redpanda/redpanda/builds/44940#018d8dc3-d067-4a62-a6ec-067850966942:
|
failure is #16540 |
/backport v23.3.x |
/backport v23.2.x |
Failed to create a backport PR to v23.2.x branch. I tried:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the excellent code comments explaining the leader_epoch!
A leader epoch is used by Kafka clients to determine if a replica is up
to date with the leader and to detect truncation.
The leader epoch differs from Raft term as the term is updated when
leader election starts. Whereas the leader epoch is updated after the
state of the replica is determined. Therefore the leader epoch uses
confirmed term instead of the simple term which is incremented every
time the leader election starts.
Backports Required
Release Notes
Bug Fixes