List:Commits« Previous MessageNext Message »
From:Timothy Smith Date:December 13 2008 12:43am
Subject:bzr commit into mysql-5.0-bugteam branch (timothy.smith:2744)
View as plain text  
#At file:///home/tsmith/m/bzr/bugteam/inno/50/ based on revid:timothy.smith@stripped

 2744 Timothy Smith	2008-12-12
      r2629 | inaam | 2008-09-16 18:46:00 +0300 (Tue, 16 Sep 2008) | 9 lines
      
      branches/5.0   bug#39483 InnoDB hang on adaptive hash because of out
      of order ::open() call by MySQL
      
      Under some conditions MySQL calls ::open with search_latch leading
      to a deadlock as we try to acquire dict_sys->mutex inside ::open
      breaking the latching order. The fix is to release search_latch.
      
      Reviewed by: Heikki
modified:
  sql/ha_innodb.cc

=== modified file 'sql/ha_innodb.cc'
--- a/sql/ha_innodb.cc	2008-07-31 21:47:57 +0000
+++ b/sql/ha_innodb.cc	2008-12-13 00:42:34 +0000
@@ -2158,6 +2158,14 @@ ha_innobase::open(
 	UT_NOT_USED(test_if_locked);
 
 	thd = current_thd;
+
+	/* Under some cases MySQL seems to call this function while
+	holding btr_search_latch. This breaks the latching order as
+	we acquire dict_sys->mutex below and leads to a deadlock. */
+	if (thd != NULL) {
+		innobase_release_temporary_latches(thd);
+	}
+
 	normalize_table_name(norm_name, name);
 
 	user_thd = NULL;

Thread
bzr commit into mysql-5.0-bugteam branch (timothy.smith:2744)Timothy Smith13 Dec