List:Commits« Previous MessageNext Message »
From:marko.makela Date:April 12 2011 6:22am
Subject:bzr commit into mysql-5.5-innodb branch (marko.makela:3365) Bug#12329920
View as plain text  
#At file:///home/marko/innobase/dev/mysql2a/5.5-innodb/ based on revid:marko.makela@strippedfzy77266ovtl

 3365 Marko Mäkelä	2011-04-12
      Bug #12329920 ASSERT UT_ERROR IN SYNC_THREAD_LEVELS_NONEMPTY_TRX
      SRV_CONC_FORCE_EXIT_INNODB
      
      This is a bogus UNIV_SYNC_DEBUG assertion failure that I introduced
      when introducing assertions for checking that InnoDB is not holding
      any mutexes or rw-locks when returning control to MySQL.
      
      srv_suspend_mysql_thread(): Release dict_operation_lock before
      invoking srv_conc_force_exit_innodb(), which would now check that the
      thread is not holding any mutexes or rw-locks.  After resuming, check
      sync_thread_levels_nonempty_trx() and do srv_conc_force_enter_innodb()
      before reacquiring the dict_operation_lock.
      
      rb:646 approved by Sunny Bains

    modified:
      storage/innobase/srv/srv0srv.c
=== modified file 'storage/innobase/srv/srv0srv.c'
--- a/storage/innobase/srv/srv0srv.c	revid:marko.makela@stripped
+++ b/storage/innobase/srv/srv0srv.c	revid:marko.makela@oracle.com-20110412062243-1h0zori8j3my3tp0
@@ -1624,17 +1624,6 @@ srv_suspend_mysql_thread(
 
 	mutex_exit(&kernel_mutex);
 
-	if (trx->declared_to_be_inside_innodb) {
-
-		was_declared_inside_innodb = TRUE;
-
-		/* We must declare this OS thread to exit InnoDB, since a
-		possible other thread holding a lock which this thread waits
-		for must be allowed to enter, sooner or later */
-
-		srv_conc_force_exit_innodb(trx);
-	}
-
 	had_dict_lock = trx->dict_operation_lock_mode;
 
 	switch (had_dict_lock) {
@@ -1662,12 +1651,34 @@ srv_suspend_mysql_thread(
 
 	ut_a(trx->dict_operation_lock_mode == 0);
 
+	if (trx->declared_to_be_inside_innodb) {
+
+		was_declared_inside_innodb = TRUE;
+
+		/* We must declare this OS thread to exit InnoDB, since a
+		possible other thread holding a lock which this thread waits
+		for must be allowed to enter, sooner or later */
+
+		srv_conc_force_exit_innodb(trx);
+	}
+
 	/* Suspend this thread and wait for the event. */
 
 	thd_wait_begin(trx->mysql_thd, THD_WAIT_ROW_TABLE_LOCK);
 	os_event_wait(event);
 	thd_wait_end(trx->mysql_thd);
 
+#ifdef UNIV_SYNC_DEBUG
+	ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
+#endif /* UNIV_SYNC_DEBUG */
+
+	if (was_declared_inside_innodb) {
+
+		/* Return back inside InnoDB */
+
+		srv_conc_force_enter_innodb(trx);
+	}
+
 	/* After resuming, reacquire the data dictionary latch if
 	necessary. */
 
@@ -1683,13 +1694,6 @@ srv_suspend_mysql_thread(
 		break;
 	}
 
-	if (was_declared_inside_innodb) {
-
-		/* Return back inside InnoDB */
-
-		srv_conc_force_enter_innodb(trx);
-	}
-
 	mutex_enter(&kernel_mutex);
 
 	/* Release the slot for others to use */
@@ -1744,10 +1748,6 @@ srv_suspend_mysql_thread(
 
 		trx->error_state = DB_INTERRUPTED;
 	}
-
-#ifdef UNIV_SYNC_DEBUG
-	ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch));
-#endif /* UNIV_SYNC_DEBUG */
 }
 
 /********************************************************************//**

Attachment: [text/bzr-bundle] bzr/marko.makela@oracle.com-20110412062243-1h0zori8j3my3tp0.bundle
Thread
bzr commit into mysql-5.5-innodb branch (marko.makela:3365) Bug#12329920marko.makela12 Apr