• Kristian Nielsen's avatar
    MDEV-12179: Per-engine mysql.gtid_slave_pos table · fdf2d407
    Kristian Nielsen authored
    Intermediate commit.
    
    Implement auto-creation of mysql.gtid_slave_pos* tables with needed engines,
    if listed in --gtid-pos-auto-engines.
    
    Uses an asynchronous approach to minimise locking overhead.
    
    The list of available tables is extended with a flag. Extra entries are
    added for --gtid-pos-auto-engines tables that do not exist yet, marked as
    not existing but ready for auto-creation.
    
    If record_gtid() needs a table marked for auto-creation, it sends a request
    to the slave background thread to create the table, and continues to use an
    existing table for the current and immediately coming transactions.
    
    As soon as the slave background thread has made the new table available, it
    will be used for all subsequent relevant transactions in record_gtid().
    
    This asynchronous approach also avoids a lot of complex issues around trying
    to do DDL in the middle of an on-going transaction.
    fdf2d407
slave.cc 264 KB