[MDEV-364] Server crashes in add_identifier on concurrent ALTER TABLE and SHOW ENGINE INNODB STATUS Created: 2012-06-24  Updated: 2012-12-25  Resolved: 2012-08-13

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.25
Fix Version/s: 5.5.27

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: upstream


 Description   

Also filed for percona-server as https://bugs.launchpad.net/percona-server/+bug/1017192

#3  <signal handler called>
#4  0x000000000069b900 in add_identifier (thd=0x3b8ab70, to_p=0x7f79b461afd9 "\260a\264y\177", end_p=0x7f79b461b0b0 "#sql-7de_2#P#p0", name=0x7f79b461b0bd "p0", name_len=4294967293) at sql/sql_table.cc:96
#5  0x000000000069c55f in explain_filename (thd=0x3b8ab70, from=0x7f79b461b0b0 "#sql-7de_2#P#p0", to=0x7f79b461afb0 "`#sql-7de_2#P#p0` /* Temporary Partition \260a\264y\177", to_length=256, explain_mode=EXPLAIN_PARTITIONS_AS_COMMENT) at sql/sql_table.cc:348
#6  0x0000000000a10e6f in innobase_convert_identifier (buf=0x7f79b461b267 "`t1` /* P", buflen=569, id=0x3ca6ad5 "#sql-7de_2#P#p0", idlen=15, thd=0x3b8ab70, file_id=1) at storage/xtradb/handler/ha_innodb.cc:2204
#7  0x0000000000a111a3 in innobase_convert_name (buf=0x7f79b461b260 "`test`.`t1` /* P", buflen=576, id=0x3ca6ad0 "test/#sql-7de_2#P#p0", idlen=20, thd=0x3b8ab70, table_id=1) at storage/xtradb/handler/ha_innodb.cc:2290
#8  0x0000000000aa8984 in ut_print_namel (f=0x37fd600, trx=0x3cd49b8, table_id=1, name=0x3ca6ad0 "test/#sql-7de_2#P#p0", namelen=20) at storage/xtradb/ut/ut0ut.c:544
#9  0x0000000000aa88fa in ut_print_name (f=0x37fd600, trx=0x3cd49b8, table_id=1, name=0x3ca6ad0 "test/#sql-7de_2#P#p0") at storage/xtradb/ut/ut0ut.c:520
#10 0x0000000000b73dfe in lock_table_print (file=0x37fd600, lock=0x3cccd48) at storage/xtradb/lock/lock0lock.c:4319
#11 0x0000000000b74c24 in lock_print_info_all_transactions (file=0x37fd600) at storage/xtradb/lock/lock0lock.c:4680
#12 0x0000000000a6e82d in srv_printf_innodb_monitor (file=0x37fd600, nowait=0, trx_start=0x7f79b461bc40, trx_end=0x7f79b461bc48) at storage/xtradb/srv/srv0srv.c:2246
#13 0x0000000000a202ea in innodb_show_status (hton=0x2ecbbc0, thd=0x3ca7c30, stat_print=0x7c89d6 <stat_print(THD*, char const*, uint, char const*, uint, char const*, uint)>) at storage/xtradb/handler/ha_innodb.cc:10494
#14 0x0000000000a20e1e in innobase_show_status (hton=0x2ecbbc0, thd=0x3ca7c30, stat_print=0x7c89d6 <stat_print(THD*, char const*, uint, char const*, uint, char const*, uint)>, stat_type=HA_ENGINE_STATUS) at storage/xtradb/handler/ha_innodb.cc:10734
#15 0x00000000007c8d38 in ha_show_status (thd=0x3ca7c30, db_type=0x2ecbbc0, stat=HA_ENGINE_STATUS) at sql/handler.cc:4793
#16 0x000000000060d128 in mysql_execute_command (thd=0x3ca7c30) at sql/sql_parse.cc:2364
#17 0x00000000006166fd in mysql_parse (thd=0x3ca7c30, rawbuf=0x3cb5248 "SHOW ENGINE INNODB STATUS", length=25, parser_state=0x7f79b461c500) at sql/sql_parse.cc:5736
#18 0x0000000000609f73 in dispatch_command (command=COM_QUERY, thd=0x3ca7c30, packet=0x3cacb21 "", packet_length=25) at sql/sql_parse.cc:1055
#19 0x000000000060922a in do_command (thd=0x3ca7c30) at sql/sql_parse.cc:794
#20 0x000000000070a4ef in do_handle_one_connection (thd_arg=0x3ca7c30) at sql/sql_connect.cc:1253
#21 0x0000000000709eda in handle_one_connection (arg=0x3ca7c30) at sql/sql_connect.cc:1168
#22 0x0000000000bffb0f in pfs_spawn_thread (arg=0x3de9940) at storage/perfschema/pfs.cc:1015
#23 0x00007f79c5f22efc in start_thread (arg=0x7f79b461d700) at pthread_create.c:304
#24 0x00007f79c529559d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

bzr version-info
revision-id: knielsen@knielsen-hq.org-20120622084255-u53u21xv3w7sqxms
date: 2012-06-22 10:42:55 +0200
build-date: 2012-06-24 20:32:59 +0400
revno: 3456

Also reproducible on 5.5.25 release binaries. Could not reproduce on 5.5.24 or on 5.3.

MTR test case:

 
--source include/have_partition.inc
--source include/have_xtradb.inc
 
CREATE TABLE IF NOT EXISTS t1 (`a` INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3),(4);
 
--connect (con1,localhost,root,,)
--let $run = 100
 
while ($run)
{
        --connection default
        --send ALTER TABLE t1 PARTITION BY HASH (`a`) PARTITIONS 4 
        --connection con1
        --let $show = 300
        while ($show)
        {
                SHOW ENGINE INNODB STATUS;
                --dec $show
        }
        --connection default
        --reap
        --dec $run
}
 
DROP TABLE t1;
 

If the MTR test case does not work, try the RQG grammar:

query_init:
        CREATE TABLE IF NOT EXISTS t1 (`a` INT) ENGINE=InnoDB
        ; INSERT INTO t1 VALUES (1),(2),(3),(4);
 
thread1:
        SHOW ENGINE INNODB STATUS;
 
query:
        ALTER TABLE t1 PARTITION BY HASH (`a`) PARTITIONS 4 ;
 

Run it as

perl ./runall.pl \
--threads=2 \
--queries=100M \
--duration=300 \
--skip-gendata \
--grammar=1.yy \
--basedir=<your basedir>



 Comments   
Comment by Patryk Pomykalski [ 2012-07-31 ]

Patch proposal:
http://pastebin.com/BXdazYud

I didn't find a way to simplify the test case.

Comment by Elena Stepanova [ 2012-07-31 ]

Hi Sergei,

Could you please take a look and decide if we can use the patch.

Comment by Sergei Golubchik [ 2012-08-13 ]

Patryk, thanks for the patch!

Comment by Sergei Golubchik [ 2012-08-13 ]

pushed

Comment by Sergei Golubchik [ 2012-12-25 ]

http://bugs.mysql.com/bug.php?id=67974

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