Skip to content
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

[v23.3.x] Use confirmed term as a source of leader epoch #16573

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #16560

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>
(cherry picked from commit 6037462)
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>
(cherry picked from commit e746f79)
@vbotbuildovich vbotbuildovich added this to the v23.3.x-next milestone Feb 11, 2024
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Feb 11, 2024
@piyushredpanda
Copy link
Contributor

/ci-repeat

1 similar comment
@piyushredpanda
Copy link
Contributor

/ci-repeat

@piyushredpanda piyushredpanda modified the milestones: v23.3.x-next, v23.3.6 Feb 20, 2024
@piyushredpanda
Copy link
Contributor

failure: 14139

@mmaslankaprv mmaslankaprv merged commit 78642d6 into redpanda-data:v23.3.x Feb 20, 2024
14 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda kind/backport PRs targeting a stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants