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

[v22.3.x] c/rm_stm: fixed returning incorrect max_collectible_offset #12191

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #12176

An off by one error in `rm_stm::max_collectible_offset` may lead to
situation in which an stm couldn't continue. If `max_collectible_offset`
returned last offset in the segment it may lead to the situation in
which the whole segment was evicted before its last entry was applied.
As the `max_collectible_offset` was returning `last_stable_offset` which
indicates the offset for which all _previous_ offsets are decided (has
no pending transactions and have been committed). In rare cases it may
lead to situation where a segment ending at offset `n` was removed even
though only `n - 1` was decided.

Signed-off-by: Michal Maslanka <[email protected]>
(cherry picked from commit 70541df)
@vbotbuildovich vbotbuildovich added this to the v22.3.x-next milestone Jul 18, 2023
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Jul 18, 2023
@mmaslankaprv mmaslankaprv marked this pull request as ready for review July 18, 2023 14:02
@mmaslankaprv mmaslankaprv self-requested a review July 18, 2023 16:22
@mmaslankaprv mmaslankaprv merged commit 96b52d2 into redpanda-data:v22.3.x Jul 18, 2023
@BenPope BenPope modified the milestones: v22.3.x-next, v22.3.23 Aug 17, 2023
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