• Oran Agra's avatar
    Different fix for the race in #13361 (#13434) · 13d227fa
    Oran Agra authored
    Recently in #13361, i attempted to fix a race between FLUSHALL and
    BGSAVE, where despite calling killRDBChild, the
    backgroundSaveDoneHandler will terminate with success.
    Turns out that even if the child didn't yet exit, there's a chance it'll
    still miss our signal and exit with success.
    in that case, we will still mess up the dirty counter (deducting
    dirty_before_bgsave) which is reset by FLUSHALL, and override the
    synchronous rdb file we saved.
    
    instead, we'll set a flag to treat the next done handler as a failed
    one.
    13d227fa
rdb.c 155 KB