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.2.x] r/consensus: update _last_leader_visible_offset on leader as well #15369

Merged
merged 6 commits into from
Dec 7, 2023

Conversation

ztlpn
Copy link
Contributor

@ztlpn ztlpn commented Dec 7, 2023

Backport of PR #14620
Backport of PR #15357

Fixes #15173
Fixes #15367

mmaslankaprv and others added 6 commits December 7, 2023 16:27
Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit c755b49)

Conflicts:
	src/v/transform/rpc/tests/transform_rpc_test.cc
Since fetch offset is validated against log end offset we should log
this information when consumer is returned out of range error.

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 61bcc77)
Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 3657bec)

Conflicts:
	src/v/transform/rpc/tests/transform_rpc_test.cc
Previously _last_leader_visible_offset was updated only from
info in append_entries requests. This meant that on a leader that was
stepping down there was a small window between stepping down and receiving
the first append_entries from the new leader, where
_last_leader_visible_offset value was bogus. This led offset_out_of_range
errors when serving valid fetch requests as a follower. Fix this by
updating _last_leader_visible_offset value while we are the leader as
well.

(cherry picked from commit 434b7fb)
This reproduces the offset_out_of_range bug fixed in the previous
commit.

(cherry picked from commit 43ba5db)
No change in validation logic.

(cherry picked from commit 55da48c)

Conflicts:
	src/v/transform/rpc/tests/transform_rpc_test.cc
@ztlpn ztlpn added this to the v23.2.18 milestone Dec 7, 2023
Copy link
Contributor

@graphcareful graphcareful left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants