<?xml version="1.0" encoding="utf-8"?>
<launchpad-bug id="702776">
  <date_last_updated>2011-01-17 07:54:38.519476+00:00</date_last_updated>
  <api_links>
    <bug_api_link>https://api.launchpad.net/1.0/bugs/702776</bug_api_link>
    <bug_owner_link>https://api.launchpad.net/1.0/~philip-stoev</bug_owner_link>
    <milestone_link></milestone_link>
    <linked_branches_collection_link>https://api.launchpad.net/1.0/bugs/702776/linked_branches</linked_branches_collection_link>
    <activity_link>https://api.launchpad.net/1.0/bugs/702776/activity</activity_link>
  </api_links>
  <bug_web_link>https://bugs.launchpad.net/bugs/702776</bug_web_link>
  <owner>Philip Stoev</owner>
  <assignee>Philip Stoev</assignee>
  <milestone_title></milestone_title>
  <duplicate_link></duplicate_link>
  <duplicate_bug_id></duplicate_bug_id>
  <title>Deadlock around remove_table_from_cache with HANDLER + DDL</title>
  <status>New</status>
  <importance>Undecided</importance>
  <created>2011-01-14 08:59:35.877606+00:00</created>
  <description>
<![CDATA[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.

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

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]]>  </description>
  <activities>
    <activity datechanged="2011-01-14T08:59:35.877606+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Philip Stoev</person>
      <message>added bug</message>
    </activity>
    <activity datechanged="2011-01-17T07:54:37.588075+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Philip Stoev (philip-stoev)]]>      </newvalue>
      <whatchanged>maria: assignee</whatchanged>
      <person>Philip Stoev</person>
      <message></message>
    </activity>
  </activities>
</launchpad-bug>
