• Vlad Lesin's avatar
    MDEV-28682 gcol.gcol_purge contaminates further execution of innodb.gap_locks · 968061fd
    Vlad Lesin authored
    ha_innobase::extra() invokes check_trx_exists() unconditionally even for
    not supported operations. check_trx_exists() creates and registers trx_t
    object if THD does not contain pointer to it. If ha_innobase::extra() does
    not support some operation, it just invokes check_trx_exists() and quites.
    If check_trx_exists() creates and registers new trx_t object for such
    operation, it will never be freed and deregistered.
    
    For example, if ha_innobase::extra() is invoked from purge thread with
    operation = HA_EXTRA_IS_ATTACHED_CHILDREN, like it goes in
    gcol.gcol_purge test, trx_t object will be registered, but not
    deregisreted, and this causes innodb.gap_lock failure, as "SHOW ENGINE
    INNODB STATUS" shows information about unexpected transaction at the end
    of trx_sys.trx_list.
    
    The fix is not to invoke check_trx_exists() for unsupported operations
    in ha_innobase::extra().
    
    Reviewed by: Marko Mäkelä
    968061fd
ha_innodb.cc 619 KB