[MDEV-763] LP:702776 - Deadlock around remove_table_from_cache with HANDLER + DDL Created: 2011-01-14  Updated: 2018-07-10  Resolved: 2018-07-10

Status: Closed
Project: MariaDB Server
Component/s: Locking
Affects Version/s: 5.1.67, 5.2.14, 5.3.12
Fix Version/s: 5.1.73, 5.2.15, 5.3.13, N/A

Type: Bug Priority: Minor
Reporter: Philip Stoev (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: Launchpad, upstream

Attachments: XML File LPexportBug702776.xml    

 Description   

maria-5.3-handler and mysql-5.1 have a tendency to deadlock if concurrent HANDLER is issued along with ALTER TABLE and logging to CSV table. mysql-5.5 is not affected.

This thread appears to be holding everyone else:

# 2011-01-14T10:56:34 #2  0x0876c07e in safe_cond_timedwait (cond=0x8a96f40, mp=0x8a965c0, abstime=0x915db738, file=0x88a8f70 "sql_base.cc", line=8881) at thr_mutex.c:550
# 2011-01-14T10:56:34 #3  0x082f2dc8 in remove_table_from_cache (thd=0xbd89d20, db=0xb6cfa3d8 "test", table_name=0xb6cfa3dd "table100_myisam_int_autoinc", flags=2,
# 2011-01-14T10:56:34     deleting=0 '\000') at sql_base.cc:8881
# 2011-01-14T10:56:34 #4  0x083ed0ae in wait_while_table_is_used (thd=0xbd89d20, table=0x91216ae8, function=HA_EXTRA_PREPARE_FOR_RENAME) at sql_table.cc:4319
# 2011-01-14T10:56:34 #5  0x083f5837 in mysql_alter_table (thd=0xbd89d20, new_db=0xa75cee48 "test", new_name=0xa75cebb8 "table100_myisam_int_autoinc", create_info=0x915dcaec,
# 2011-01-14T10:56:34     table_list=0xa75cec48, alter_info=0x915dcb84, order_num=0, order=0x0, ignore=false) at sql_table.cc:7603
# 2011-01-14T10:56:34 #6  0x08299197 in mysql_execute_command (thd=0xbd89d20) at sql_parse.cc:2917
# 2011-01-14T10:56:34 #7  0x082a2a8b in mysql_parse (thd=0xbd89d20, rawbuf=0xa75cead8 "ALTER TABLE `table100_myisam_int_autoinc` ENGINE = Memory", length=57,
# 2011-01-14T10:56:34     found_semicolon=0x915dd228) at sql_parse.cc:6083
# 2011-01-14T10:56:34 #8  0x08295107 in dispatch_command (command=COM_QUERY, thd=0xbd89d20, packet=0xbd904b9 "ALTER TABLE `table100_myisam_int_autoinc` ENGINE = Memory",
# 2011-01-14T10:56:34     packet_length=57) at sql_parse.cc:1211
# 2011-01-14T10:56:34 #9  0x082945b4 in do_command (thd=0xbd89d20) at sql_parse.cc:904
# 2011-01-14T10:56:34 #10 0x08291692 in handle_one_connection (arg=0xbd89d20) at sql_connect.cc:1154
# 2011-01-14T10:56:34 #11 0x00821919 in start_thread () from /lib/libpthread.so.0
# 2011-01-14T10:56:34 #12 0x0076acce in clone () from /lib/libc.so.6

no timeout option applies in this case and the deadlock is permanent and unkillable.

RQG command line:

perl runall.pl --grammar=conf/engines/handler.yy --gendata=conf/engines/handler.zz --threads=1 --basedir=/home/philips/bzr/maria-5.3-handler/ --queries=100K --duration=600 --threads=10 --mysqld=--loose-lock-wait-timeout=1 --mysqld=--loose-table-lock-wait-timeout=1



 Comments   
Comment by Rasmus Johansson (Inactive) [ 2011-01-17 ]

Launchpad bug id: 702776

Comment by Elena Stepanova [ 2013-02-07 ]

Reproducible on maria/5.2 and maria/5.3 (I assume 5.1 too, although I didn't check specifically), and on mysql-5.1.
Not reproducible on maria/5.5 or maria/10.0.

I'm setting it to Minor because it's an upstream problem which only affects 5.1-based versions.

Comment by Elena Stepanova [ 2018-07-10 ]

Closing since 5.1-5.3 are not maintained anymore.

Generated at Thu Feb 08 06:31:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.