• Nikita Malyavin's avatar
    MDEV-30925 Assertion failed in translog_write_record in ONLINE ALTER + Aria · 6b35d6a9
    Nikita Malyavin authored
    This is the corner case of ONLINE ALTER vs ha_maria vs App-time Periods.
    
    When a Delete_rows_event (or update) is executed, a lookup handler may be
    created, normally to serve long unique index needs, by a call of
    handler::prepare_for_insert. This function also creates a lookup handler
    if an application-time period exists in a table.
    
    A difference with a usual call of prepare_for_insert is that transactions
    are disabled for this table during ALTER TABLE. See
    mysql_trans_prepare_alter_copy_data call in copy_data_between_tables.
    
    Then, ha_maria calls _ma_tmp_disable_logging_for_table during
    ha_maria::external_lock. It never happened so before, that two handlers
    would be created for write to a single ha_maria table under transactions
    disabled.
    
    Hence, the fix handles this scenario.
    It could be done otherwise, by not creating this lookup handler (since it's
    not used anyway during ONLINE ALTER), but architecturally, two handlers
    should be supported.
    
    Avoiding the creation of lookup handler could be done here additionally,
    but with a cost of slowing down other more generic cases, with an
    additional check of online alter table active.
    6b35d6a9
alter_table_online_debug.result 32.2 KB