• seppo's avatar
    MDEV-19572 async slave node fails to apply MyISAM only writes (#1418) · 38839854
    seppo authored
    The problem happens when MariaDB master replicates writes for only non InnoDB
    tables (e.g. writes to MyISAM table(s)). Async slave node, in Galera cluster,
    can apply these writes successfully, but it will, in the end, write gtid position in
    mysql.gtid_slave_pos table. mysql.gtid_slave_pos table is InnoDB engine, and
    this write makes innodb handlerton part of the replicated "transaction".
    Note that wsrep patch identifies that write to gtid_slave_pos should not be replicated
    and skips appending wsrep keys for these writes. However, as InnoDB was present
    in the transaction, and there are replication events (for MyISAM table) in transaction
    cache, but there are no appended keys, wsrep raises an error, and this makes the söave
    thread to stop.
    
    The fix is simply to not treat it as an error if async slave tries to replicate a write
    set with binlog events, but no keys. We just skip wsrep replication and return successfully.
    
    This commit contains also a mtr test which forces mysql.gtid_slave_pos table isto be
    of InnoDB engine, and executes MyISAM only write through asyn replication.
    
    There is additional fix for declaring IO and background slave threads as non wsrep.
    These threads should not write anything for wsrep replication, and this is just a safeguard
    to make sure nothing leaks into cluster from these slave threads.
    38839854
galera_as_slave_gtid_myisam.result 424 Bytes