Server crashes in _ma_remove_table_from_trnman on concurrent ALTER and SELECT

Bug #947487 reported by Elena Stepanova on 2012-03-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
Medium
Michael Widenius

Bug Description

See also https://bugs.launchpad.net/maria/+bug/947474.
The reason of both problems might be the same, as they happen with the exact same test case, but since it fails in both threads, sometimes on SELECT with assertion from bug#947474 and sometimes with the crash on ALTER, I will file both.

#3 <signal handler called>
#4 0x00000000009610a6 in _ma_remove_table_from_trnman (share=0x30ce0c0, trn=0x307d770)
    at /home/elenst/maria-5.5/storage/maria/ma_state.c:559
#5 0x00000000009b8fde in maria_extra (info=0x31838f0, function=HA_EXTRA_PREPARE_FOR_RENAME, extra_arg=0x0)
    at /home/elenst/maria-5.5/storage/maria/ma_extra.c:347
#6 0x0000000000974f3e in ha_maria::extra (this=0x31a6ac8, operation=HA_EXTRA_PREPARE_FOR_RENAME)
    at /home/elenst/maria-5.5/storage/maria/ha_maria.cc:2478
#7 0x0000000000c859fa in ha_partition::loop_extra (this=0x31a5fe8, operation=HA_EXTRA_PREPARE_FOR_RENAME)
    at /home/elenst/maria-5.5/sql/ha_partition.cc:6226
#8 0x0000000000c85918 in ha_partition::prepare_for_rename (this=0x31a5fe8)
    at /home/elenst/maria-5.5/sql/ha_partition.cc:6198
#9 0x0000000000c8531c in ha_partition::extra (this=0x31a5fe8, operation=HA_EXTRA_PREPARE_FOR_RENAME)
    at /home/elenst/maria-5.5/sql/ha_partition.cc:5968
#10 0x00000000005cc513 in wait_while_table_is_used (thd=0x7fe2ec11f070, table=0x31a5630,
    function=HA_EXTRA_PREPARE_FOR_RENAME) at /home/elenst/maria-5.5/sql/sql_base.cc:2334
#11 0x00000000006c49bb in mysql_alter_table (thd=0x7fe2ec11f070, new_db=0x3070b20 "test",
    new_name=0x3070540 "A", create_info=0x7fe2f1a5cd70, table_list=0x3070578, alter_info=0x7fe2f1a5ce70,
    order_num=0, order=0x0, ignore=false, require_online=false)
    at /home/elenst/maria-5.5/sql/sql_table.cc:6862
#12 0x00000000009419eb in Alter_table_statement::execute (this=0x3070d40, thd=0x7fe2ec11f070)
    at /home/elenst/maria-5.5/sql/sql_alter.cc:106
#13 0x000000000062eaf4 in mysql_execute_command (thd=0x7fe2ec11f070)
    at /home/elenst/maria-5.5/sql/sql_parse.cc:4454
#14 0x0000000000631bec in mysql_parse (thd=0x7fe2ec11f070,
    rawbuf=0x3070468 "ALTER TABLE `A` PARTITION BY KEY() PARTITIONS 9", length=47,
    parser_state=0x7fe2f1a5d670) at /home/elenst/maria-5.5/sql/sql_parse.cc:5730
#15 0x0000000000625abd in dispatch_command (command=COM_QUERY, thd=0x7fe2ec11f070,
    packet=0x7fe2ec1247a1 "ALTER TABLE `A` PARTITION BY KEY() PARTITIONS 9", packet_length=47)
    at /home/elenst/maria-5.5/sql/sql_parse.cc:1056
#16 0x0000000000624d90 in do_command (thd=0x7fe2ec11f070) at /home/elenst/maria-5.5/sql/sql_parse.cc:795
#17 0x000000000071f729 in do_handle_one_connection (thd_arg=0x7fe2ec11f070)
    at /home/elenst/maria-5.5/sql/sql_connect.cc:1253
#18 0x000000000071f1ec in handle_one_connection (arg=0x7fe2ec11f070)
    at /home/elenst/maria-5.5/sql/sql_connect.cc:1168
#19 0x00007fe3096d3a4f in start_thread () from /lib64/libpthread.so.0
#20 0x00007fe30846882d in clone () from /lib64/libc.so.6

bzr version-info
revision-id: <email address hidden>
date: 2012-03-03 13:22:49 -0800
build-date: 2012-03-05 23:00:19 +0200
revno: 3311

Could not reproduce on 5.3.
Could not reproduce on the release build 5.5.20.
Could not convert into an MTR test, it might require a deeper insight into the root of the problem, and possibly usage of synchronization points.

# RQG grammar (test.yy):

partitions:
        ALTER TABLE _table PARTITION BY KEY() PARTITIONS part_num |
        ALTER TABLE _table REMOVE PARTITIONING;

query:
        SELECT * FROM _table ;

thread1:
        partitions ;

part_num:
        1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;

# End of RQG grammar

# Run as

perl runall.pl \
--threads=2 \
--duration=3600 \
--queries=100M \
--grammar=./test.yy \
--engine=Aria \
--rows=1,1,1,1,1,1,1,1,1 \
--mtr-build-thread=300 \
--basedir1=<5.5 debug basedir> \
--vardir1=<your vardir>

Elena Stepanova (elenst) on 2012-03-05
description: updated
Elena Stepanova (elenst) wrote :

Also filed as JIRA issue MDEV-171

Elena Stepanova (elenst) on 2012-03-05
description: updated
Changed in maria:
assignee: nobody → Michael Widenius (monty)
Michael Widenius (monty) wrote :

Fixed with patch for lp:947474

Changed in maria:
status: New → In Progress
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers