• Thirunarayanan Balathandayuthapani's avatar
    MDEV-29250 InnoDB: Failing assertion: table->get_ref_count() == 0 · 7624bf86
    Thirunarayanan Balathandayuthapani authored
    Reason:
    ======
     This issue is caused by race condition between fulltext DDL and
    purge thread. DDL sets the signal to stop the purge thread to
    process the new undo log records and wait for the ongoing
    processed FTS table undo log records to finish.
    
    But in dict_acquire_mdl_shared(),InnoDB release all innodb
    table related locks before acquiring the mdl. At the same time,
    DDL assumes that there are no purge threads working on fts table.
    
    There is a possiblity that purge thread can skip processing the
    valid undo log records if it checks purge_sys.must_wait_FTS() twice
    in different places.
    
    Solution:
    ==========
    
    Add the purge_sys.must_wait_FTS() check in dict_acquire_mdl_shared()
    to avoid the purge thread processing undo log records.
    
    dict_open_table_on_id(): return -1 if the purge thread has to
    wait
    
    dict_acquire_mdl_shared(): Added 1 new parameters to indicate that
    purge thread invoking the function, return -1  if the purge
    thread has to wait.
    7624bf86
row0purge.cc 33.5 KB