• unknown's avatar
    MDEV-5804: If same GTID is received on multiple master connections in... · 2c2478b8
    unknown authored
    MDEV-5804: If same GTID is received on multiple master connections in multi-source replication, the event is double-executed causing corruption or replication failure
    
    Before, the arrival of same GTID twice in multi-source replication
    would cause double-apply or in gtid strict mode an error.
    
    Keep the behaviour, but add an option --gtid-ignore-duplicates which
    allows to correctly handle duplicates, ignoring all but the first.
    This relies on the user ensuring correct configuration so that
    sequence numbers are strictly increasing within each replication
    domain; then duplicates can be detected simply by comparing the
    sequence numbers against what is already applied.
    
    Only one master connection (but possibly multiple parallel worker
    threads within that connection) is allowed to apply events within
    one replication domain at a time; any other connection that
    receives a GTID in the same domain either discards it (if it is
    already applied) or waits for the other connection to not have
    any events to apply.
    
    Intermediate patch, as proof-of-concept for testing. The main limitation
    is that currently it is only implemented for parallel replication,
    @@slave_parallel_threads > 0.
    2c2478b8
rpl_gtid.cc 55.1 KB