-
Notifications
You must be signed in to change notification settings - Fork 591
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] Fixed race condition in disk_log_impl::truncate_prefix
#24284
base: v24.1.x
Are you sure you want to change the base?
[v24.1.x] Fixed race condition in disk_log_impl::truncate_prefix
#24284
Conversation
Added log entry showing a next offset used to initialize log appender. Signed-off-by: Michał Maślanka <[email protected]> (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 <[email protected]> (cherry picked from commit 189098d)
Added a test validating concurrent operations of writing and prefix truncating a log. Signed-off-by: Michał Maślanka <[email protected]> (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 <[email protected]> (cherry picked from commit 09feb36)
the below tests from https://buildkite.com/redpanda/redpanda/builds/58691#019363d2-426b-49cb-9b45-c4b413f168b6 have failed and will be retried
|
non flaky failures in https://buildkite.com/redpanda/redpanda/builds/58691#01936417-50d8-41e7-bdda-a57b0cdf109d:
|
Retry command for Build#58691please wait until all jobs are finished before running the slash command
|
Backport of PR #21324
Fixes: #24281,