• antirez's avatar
    Undo slaves state change on failed rdbSaveToSlavesSockets(). · 8e555374
    antirez authored
    As Oran Agra suggested, in startBgsaveForReplication() when the BGSAVE
    attempt returns an error, we scan the list of slaves in order to remove
    them since there is no way to serve them currently.
    
    However we check for the replication state BGSAVE_START, which was
    modified by rdbSaveToSlaveSockets() before forking(). So when fork fails
    the state of slaves remain BGSAVE_END and no cleanup is performed.
    
    This commit fixes the problem by making rdbSaveToSlavesSockets() able to
    undo the state change on fork failure.
    8e555374
rdb.c 61.3 KB