[MDEV-28030] row_discard_tablespace_for_mysql() can unlock data dictionary without locking data dictionary Created: 2022-03-09  Updated: 2022-03-11  Resolved: 2022-03-11

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.6.6
Fix Version/s: 10.6.8, 10.7.4, 10.8.3

Type: Bug Priority: Major
Reporter: Thirunarayanan Balathandayuthapani Assignee: Thirunarayanan Balathandayuthapani
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-27006 Assertion `!lock_trx_has_sys_table_lo... Closed

 Description   

row_discard_tablespace_for_mysql() can call row_mysql_unlock_data_dictionary() without locking it.

if (fts_exist)
  {     
    fts_optimize_remove_table(table);
    purge_sys.stop_FTS(*table);
    err= fts_lock_tables(trx, *table);
    if (err != DB_SUCCESS)
    {
rollback:
      if (fts_exist)
      {
        purge_sys.resume_FTS();
        fts_optimize_add_table(table);
      } 
      trx->rollback();
      row_mysql_unlock_data_dictionary(trx);
      return err;
    }
  }
 
  row_mysql_lock_data_dictionary(trx);
  trx->op_info = "discarding tablespace";
  trx->dict_operation= true;
 
  /* We serialize data dictionary operations with dict_sys.latch:
  this is to avoid deadlocks during data dictionary operations */
 
  err= row_discard_tablespace_foreign_key_checks(trx, table);
  if (err != DB_SUCCESS)
    goto rollback;


Generated at Thu Feb 08 09:57:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.