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

[v24.1.x] s/disk_log_impl: don't prefix-truncate empty segments #19801

Merged

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #19790
Fixes: #19800,

Consider the following sequence of events:
1. there is a single segment in the log, with offsets [0-9]
2. we call prefix_truncate(10)
3. concurrently, another batch of 5 messages is being appended.
4. empty segment with base_offset=10, dirty_offset=9 is created
5. the appended batch is placed at offsets 10-14

Previously, the empty segment would have passed the dirty_offset check
and (after waiting for the append to finish) would get deleted
(including the data at offsets 10-14). Check also the segment base_offset
to prevent that.

Fixes redpanda-data#19632

(cherry picked from commit 963ff23)
@vbotbuildovich vbotbuildovich added this to the v24.1.x-next milestone Jun 12, 2024
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Jun 12, 2024
@vbotbuildovich vbotbuildovich requested a review from ztlpn June 12, 2024 12:37
@ztlpn ztlpn merged commit 60442f1 into redpanda-data:v24.1.x Jun 12, 2024
18 checks passed
@piyushredpanda piyushredpanda modified the milestones: v24.1.x-next, v24.1.8 Jun 14, 2024
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