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] Fixed race condition in disk_log_impl::truncate_prefix #24284

Open
wants to merge 4 commits into
base: v24.1.x
Choose a base branch
from

Commits on Nov 25, 2024

  1. s/disk_log_impl: added log entry when creating log appender

    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)
    mmaslankaprv authored and vbotbuildovich committed Nov 25, 2024
    Configuration menu
    Copy the full SHA
    15f25de View commit details
    Browse the repository at this point in the history
  2. s/log: fixed race condition in append and truncate prefix

    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)
    mmaslankaprv authored and vbotbuildovich committed Nov 25, 2024
    Configuration menu
    Copy the full SHA
    dfcaba1 View commit details
    Browse the repository at this point in the history
  3. s/tests: added test validating concurrent operations

    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)
    mmaslankaprv authored and vbotbuildovich committed Nov 25, 2024
    Configuration menu
    Copy the full SHA
    7f1d5d4 View commit details
    Browse the repository at this point in the history
  4. s/log: removed the line informing user about outstanding locks

    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)
    mmaslankaprv authored and vbotbuildovich committed Nov 25, 2024
    Configuration menu
    Copy the full SHA
    7dffcf7 View commit details
    Browse the repository at this point in the history