Commit cb73a044 authored by Marko Mäkelä's avatar Marko Mäkelä

Bug#56114 Disallow trx->dict_operation_lock_mode==RW_X_LATCH in srv_suspend_mysql_thread()

Issue an error message to the error log when
trx->dict_operation_lock_mode == RW_X_LATCH in
srv_suspend_mysql_thread(). Transactions that modify InnoDB
data dictionary tables must be free of lock waits, because they
must be holding the data dictionary latch in exclusive mode.
The transactions must not be accessing any other tables other than
the data dictionary tables.

The handling of RW_X_LATCH was accidentally added in the InnoDB Plugin,
as a wrong fix of an assertion failure. (Fast index creation was accessing
both data dictionary tables and user tables in the same transaction.)
parent 97a780f1
...@@ -1588,6 +1588,18 @@ srv_suspend_mysql_thread( ...@@ -1588,6 +1588,18 @@ srv_suspend_mysql_thread(
row_mysql_unfreeze_data_dictionary(trx); row_mysql_unfreeze_data_dictionary(trx);
break; break;
case RW_X_LATCH: case RW_X_LATCH:
/* There should never be a lock wait when the
dictionary latch is reserved in X mode. Dictionary
transactions should only acquire locks on dictionary
tables, not other tables. All access to dictionary
tables should be covered by dictionary
transactions. */
ut_print_timestamp(stderr);
fputs(" InnoDB: Error: dict X latch held in "
"srv_suspend_mysql_thread\n", stderr);
/* This should never occur. This incorrect handling
was added in the early development of
ha_innobase::add_index() in InnoDB Plugin 1.0. */
/* Release fast index creation latch */ /* Release fast index creation latch */
row_mysql_unlock_data_dictionary(trx); row_mysql_unlock_data_dictionary(trx);
break; break;
...@@ -1607,6 +1619,9 @@ srv_suspend_mysql_thread( ...@@ -1607,6 +1619,9 @@ srv_suspend_mysql_thread(
row_mysql_freeze_data_dictionary(trx); row_mysql_freeze_data_dictionary(trx);
break; break;
case RW_X_LATCH: case RW_X_LATCH:
/* This should never occur. This incorrect handling
was added in the early development of
ha_innobase::add_index() in InnoDB Plugin 1.0. */
row_mysql_lock_data_dictionary(trx); row_mysql_lock_data_dictionary(trx);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment