diff options
author | Marko Mäkelä <marko.makela@oracle.com> | 2011-04-12 09:22:43 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@oracle.com> | 2011-04-12 09:22:43 +0300 |
commit | 1ef8d5fc34fb3e86f7ea1838e6d9867a10dd2910 (patch) | |
tree | 918f90df0a43212c318eac7fced516d5522224ad /storage/innobase | |
parent | cdba023d9a2d2db59cf1cd5ef6b0ded0bbaa5807 (diff) | |
download | mariadb-git-1ef8d5fc34fb3e86f7ea1838e6d9867a10dd2910.tar.gz |
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
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/srv/srv0srv.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index ecf1432016d..789fe3bf36a 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -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 */ } /********************************************************************//** |