[MDEV-5964] main.mdev-504 unveils assertion failure in TABLE_SHARE::visit_subgraph Created: 2014-03-27  Updated: 2014-03-28  Resolved: 2014-03-28

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.9
Fix Version/s: 10.0.10

Type: Bug Priority: Critical
Reporter: Sergey Vojtovich Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-5492 Reduce usage of LOCK_open: TABLE::in_use Closed

 Description   

main.mdev-504 fails sporadically. A simplified mtr test:

CREATE TABLE t1(a INT);
SELECT * FROM t1;
SET debug_sync='tc_acquire_table SIGNAL ready WAIT_FOR go';
--send SELECT * FROM t1
 
connect(con1, localhost, root,, test);
SET debug_sync='now WAIT_FOR ready';
FLUSH TABLE t1;
SET debug_sync='now SIGNAL go';
 
connection default;
reap;
disconnect con1;
DROP TABLE t1;

Needs debug sync point:

=== modified file 'sql/table_cache.cc'
--- sql/table_cache.cc	2014-03-20 07:11:13 +0000
+++ sql/table_cache.cc	2014-03-27 15:02:31 +0000
@@ -334,6 +334,8 @@ static TABLE *tc_acquire_table(THD *thd,
   table= share->tdc.free_tables.pop_front();
   mysql_mutex_unlock(&share->tdc.LOCK_table_share);
 
+  DEBUG_SYNC(thd, "tc_acquire_table");
+
   if (table)
   {
     DBUG_ASSERT(!table->in_use);

The simplest way to fix it is to move "table->in_use= thd;" under protection of LOCK_table_share.



 Comments   
Comment by Sergey Vojtovich [ 2014-03-28 ]

Sergei, please review fix for this bug.

Comment by Sergei Golubchik [ 2014-03-28 ]

ok to push!

Comment by Sergey Vojtovich [ 2014-03-28 ]

Fixed in 10.0.10, revno: 4133, revision-id: svoj@mariadb.org-20140328073010-w60enwnaz6gh78wq

Generated at Thu Feb 08 07:08:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.