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.1.x] c/rm_stm: fixed returning incorrect max_collectible_offset #12190

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 v23.1.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:01
@piyushredpanda piyushredpanda merged commit 62cd290 into redpanda-data:v23.1.x Jul 18, 2023
22 checks passed
@BenPope BenPope modified the milestones: v23.1.x-next, v23.1.14 Aug 7, 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.

None yet

5 participants