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.3.x] Fixed race condition in disk_log_impl::truncate_prefix #24282

Conversation

vbotbuildovich
Copy link
Collaborator

Backport of PR #21324
Fixes: #24280,

Added log entry showing a next offset used to initialize log appender.

Signed-off-by: Michał Maślanka <michal@redpanda.com>
(cherry picked from commit b0c152d)
Fixed a race condition which may lead to a situation in which the same
offset was assigned to two different records appended to the log. The
race condition was happening when one one fiber was appending batches to
the log while the other one was prefix truncating it. (Raft does it when
taking a snapshot). In this situation it might happened that the
batches were appended to the segment which was about to be deleted in
`remove_segment_permanently`. This lead to a situation in which an
appended batch was lost and the same offset was assigned to the next
one. This lead to assertion triggered in `mux_state_machine`

Fixes:

Signed-off-by: Michał Maślanka <michal@redpanda.com>
(cherry picked from commit 189098d)
Added a test validating concurrent operations of writing and prefix
truncating a log.

Signed-off-by: Michał Maślanka <michal@redpanda.com>
(cherry picked from commit 3a9d721)
Removed the line that informed the user about outstanding locks keeping
the segment alive as now the lock is cleared before the segment is
closed.

Signed-off-by: Michał Maślanka <michal@redpanda.com>
(cherry picked from commit 09feb36)
@vbotbuildovich vbotbuildovich added this to the v24.3.x-next milestone Nov 25, 2024
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label Nov 25, 2024
@vbotbuildovich
Copy link
Collaborator Author

the below tests from https://buildkite.com/redpanda/redpanda/builds/58690#019363d2-176c-46fe-8e5e-55e20f2edf70 have failed and will be retried

storage_e2e_single_thread_rpunit

@piyushredpanda piyushredpanda merged commit 5c9150c into redpanda-data:v24.3.x Nov 26, 2024
16 checks passed
@piyushredpanda piyushredpanda modified the milestones: v24.3.x-next, v24.3.2 Dec 6, 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