• unknown's avatar
    MDEV-4506: Parallel replication · dcb3650d
    unknown authored
    MDEV-5217: Incorrect MyISAM event execution order causing incorrect parallel replication
    
    In parallel replication, if transactions A,B group-commit together on the
    master, we can execute them in parallel on a replication slave. But then, if
    transaction C follows on the master, on the slave, we need to be sure that
    both A and B have completed before starting on C to be sure to avoid
    conflicts.
    
    The necessary wait is implemented such that B waits for A to commit before it
    commits itself (thus preserving commit order). And C waits for B to commit
    before it itself can start executing. This way C does not start until both A
    and B have completed.
    
    The wait for B's commit on A happens inside the commit processing. However, in
    the case of MyISAM with no binlog enabled on the slave, it appears that no
    commit processing takes place (since MyISAM is non-transactional), and thus
    the wait of B for A was not done. This allowed C to start before A, which can
    lead to conflicts and incorrect replication.
    
    Fixed by doing an extra wait for A at the end of B before signalling C.
    dcb3650d
rpl_parallel.cc 32.2 KB