• unknown's avatar
    MDEV-4506: Parallel replication · c834242a
    unknown authored
    MDEV-5217: SQL thread hangs during stop if error occurs in the middle of an event group
    
    Normally, when we stop the slave SQL thread in parallel replication, we want
    the worker threads to continue processing events until the end of the current
    event group. But if we stop due to an error that prevents further events from
    being queued, such as an error reading the relay log, no more events can be
    queued for the workers, so they have to abort even if they are in the middle
    of an event group. There was a bug that we would deadlock, the workers
    waiting for more events to be queued for the event group, the SQL thread
    stopped and waiting for the workers to complete their current event group
    before exiting.
    
    Fixed by now signalling from the SQL thread to all workers when it is about
    to exit, and cleaning up in all workers when so signalled.
    
    This patch fixes one of multiple problems reported in MDEV-5217.
    c834242a
rpl_parallel.cc 31.3 KB