Skip to content
Snippets Groups Projects
  • Vladimir Davydov's avatar
    fc3196dc
    vinyl: wake up waiters after clearing checkpoint_in_progress flag · fc3196dc
    Vladimir Davydov authored
    The function `vy_space_build_index`, which builds a new index on DDL,
    calls `vy_scheduler_dump` on completion. If there's a checkpoint in
    progress, the latter will wait on `vy_scheduler::dump_cond` until
    `vy_scheduler::checkpoint_in_progress` is cleared. The problem is
    `vy_scheduler_end_checkpoint` doesn't broadcast `dump_cond` when it
    clears the flag. Usually, everything works fine because the condition
    variable is broadcast on any dump completion, and vinyl checkpoint
    implies a dump, but under certain conditions this may lead to a fiber
    hang. Let's broadcast `dump_cond` in `vy_scheduler_end_checkpoint`
    to be on the safe side.
    
    While we are at it, let's also inject a dump delay to the original
    test to make it more robust.
    
    Closes #10267
    Follow-up #10234
    
    NO_DOC=bug fix
    fc3196dc
    History
    vinyl: wake up waiters after clearing checkpoint_in_progress flag
    Vladimir Davydov authored
    The function `vy_space_build_index`, which builds a new index on DDL,
    calls `vy_scheduler_dump` on completion. If there's a checkpoint in
    progress, the latter will wait on `vy_scheduler::dump_cond` until
    `vy_scheduler::checkpoint_in_progress` is cleared. The problem is
    `vy_scheduler_end_checkpoint` doesn't broadcast `dump_cond` when it
    clears the flag. Usually, everything works fine because the condition
    variable is broadcast on any dump completion, and vinyl checkpoint
    implies a dump, but under certain conditions this may lead to a fiber
    hang. Let's broadcast `dump_cond` in `vy_scheduler_end_checkpoint`
    to be on the safe side.
    
    While we are at it, let's also inject a dump delay to the original
    test to make it more robust.
    
    Closes #10267
    Follow-up #10234
    
    NO_DOC=bug fix