[Commits] Rev 4133: MDEV-5964 - main.mdev-504 unveils assertion failure in in lp:maria/10.0

Sergey Vojtovich svoj at mariadb.org
Fri Mar 28 21:23:35 EET 2014


At lp:maria/10.0

------------------------------------------------------------
revno: 4133
revision-id: svoj at mariadb.org-20140328073010-w60enwnaz6gh78wq
parent: psergey at askmonty.org-20140328191833-hctiv4m4nc4res4u
committer: Sergey Vojtovich <svoj at mariadb.org>
branch nick: 10.0
timestamp: Fri 2014-03-28 11:30:10 +0400
message:
  MDEV-5964 - main.mdev-504 unveils assertion failure in
              TABLE_SHARE::visit_subgraph
  
  tc_acquire_table() is not ready to update TABLE::in_use without mutex:
  thr1: table= free_tables.pop_front(); // table->in_use is 0
  thr2: tdc_remove_table();
  thr2: find_deadlock(); // assert(table->in_use != 0)
  thr1: table->in_use= thd;
  
  Protect update of TABLE::in_use by LOCK_table_share.
=== modified file 'sql/table_cache.cc'
--- a/sql/table_cache.cc	2014-03-20 07:11:13 +0000
+++ b/sql/table_cache.cc	2014-03-28 07:30:10 +0000
@@ -332,8 +332,6 @@ static TABLE *tc_acquire_table(THD *thd,
 
   mysql_mutex_lock(&share->tdc.LOCK_table_share);
   table= share->tdc.free_tables.pop_front();
-  mysql_mutex_unlock(&share->tdc.LOCK_table_share);
-
   if (table)
   {
     DBUG_ASSERT(!table->in_use);
@@ -343,6 +341,7 @@ static TABLE *tc_acquire_table(THD *thd,
     /* The children must be detached from the table. */
     DBUG_ASSERT(!table->file->extra(HA_EXTRA_IS_ATTACHED_CHILDREN));
   }
+  mysql_mutex_unlock(&share->tdc.LOCK_table_share);
   return table;
 }
 



More information about the commits mailing list