#At file:///home/marko/innobase/dev/mysql2a/5.5-innodb/ based on revid:jimmy.yang@strippedtukdtb23jv
3168 Marko Mäkelä 2010-08-19
Bug#56114 Disallow trx->dict_operation_lock_mode==RW_X_LATCH in srv_suspend_mysql_thread()
Only allow trx->dict_operation_lock_mode to be 0 or RW_S_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.
This code 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.)
modified:
storage/innobase/srv/srv0srv.c
=== modified file 'storage/innobase/srv/srv0srv.c'
--- a/storage/innobase/srv/srv0srv.c revid:jimmy.yang@oracle.com-20100819041647-wx9t9jtukdtb23jv
+++ b/storage/innobase/srv/srv0srv.c revid:marko.makela@stripped0819102332-vfmgh7uzdfpndq1h
@@ -1583,13 +1583,20 @@ srv_suspend_mysql_thread(
had_dict_lock = trx->dict_operation_lock_mode;
switch (had_dict_lock) {
+ case 0:
+ break;
case RW_S_LATCH:
/* Release foreign key check latch */
row_mysql_unfreeze_data_dictionary(trx);
break;
- case RW_X_LATCH:
- /* Release fast index creation latch */
- row_mysql_unlock_data_dictionary(trx);
+ default:
+ /* 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_error;
break;
}
@@ -1602,13 +1609,8 @@ srv_suspend_mysql_thread(
/* After resuming, reacquire the data dictionary latch if
necessary. */
- switch (had_dict_lock) {
- case RW_S_LATCH:
+ if (had_dict_lock) {
row_mysql_freeze_data_dictionary(trx);
- break;
- case RW_X_LATCH:
- row_mysql_lock_data_dictionary(trx);
- break;
}
if (was_declared_inside_innodb) {
Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20100819102332-vfmgh7uzdfpndq1h.bundle
| Thread |
|---|
| • bzr commit into mysql-5.5-innodb branch (marko.makela:3168) Bug#56114 | marko.makela | 19 Aug |