List:Commits« Previous MessageNext Message »
From:marko.makela Date:August 19 2010 12:36pm
Subject:bzr commit into mysql-trunk-innodb branch (marko.makela:3262) Bug#56114
View as plain text  
#At file:///home/marko/innobase/dev/mysql2a/next-mr/ based on revid:marko.makela@stripped4c7b3sq9q

 3262 Marko Mäkelä	2010-08-19
      Bug#56114 Disallow trx->dict_operation_lock_mode==RW_X_LATCH in srv_suspend_mysql_thread()
      
      Trigger an assertion failure when
      trx->dict_operation_lock_mode is neither 0 nor 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.
      
      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.)

    modified:
      storage/innobase/srv/srv0srv.c
=== modified file 'storage/innobase/srv/srv0srv.c'
--- a/storage/innobase/srv/srv0srv.c	revid:marko.makela@oracle.com-20100819122614-2fi2ulv4c7b3sq9q
+++ b/storage/innobase/srv/srv0srv.c	revid:marko.makela@stripped123609-5lryfm8zmb8t1fqq
@@ -1587,26 +1587,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:
+	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_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;
+		ut_error;
 	}
 
 	ut_a(trx->dict_operation_lock_mode == 0);
@@ -1618,16 +1612,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:
-		/* 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;
 	}
 
 	if (was_declared_inside_innodb) {

Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20100819123609-5lryfm8zmb8t1fqq.bundle
Thread
bzr commit into mysql-trunk-innodb branch (marko.makela:3262) Bug#56114marko.makela19 Aug