summaryrefslogtreecommitdiff
path: root/storage/innobase/srv
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2010-08-19 13:36:37 +0300
committerMarko Mäkelä <marko.makela@oracle.com>2010-08-19 13:36:37 +0300
commitcb73a044f85f2aa33e6a46ab4c71b7a586583679 (patch)
treec703cbd14f8cb1ebe5dc98f11612692a0ed0ec8c /storage/innobase/srv
parent97a780f1f9d4f6eab74007de7f08969ef7a8800a (diff)
downloadmariadb-git-cb73a044f85f2aa33e6a46ab4c71b7a586583679.tar.gz
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.)
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r--storage/innobase/srv/srv0srv.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index bea8d7f8fdc..ce56a533d5e 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -1588,6 +1588,18 @@ srv_suspend_mysql_thread(
row_mysql_unfreeze_data_dictionary(trx);
break;
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 */
row_mysql_unlock_data_dictionary(trx);
break;
@@ -1607,6 +1619,9 @@ srv_suspend_mysql_thread(
row_mysql_freeze_data_dictionary(trx);
break;
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);
break;
}