Assertion `table->file->stats.records > 0 || error' failed join_read_const_table on concurrent SELECT and DROP/ADD INDEX
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
High
|
Michael Widenius |
Bug Description
Version: '5.5.24-
mysqld: sql/sql_
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x28024f8): SELECT t1.f FROM A AS t1 LEFT JOIN B AS t2 ON 0 WHERE t1.f != 5
Connection ID (thread ID): 7
Status: NOT_KILLED
Below is stack trace for all threads (this time the test was run with skip-innodb and aria-checkpoint
Thread 6 (Thread 21247):
#0 0x00007fbe19602709 in pthread_
#1 0x0000000001162be3 in safe_cond_timedwait (cond=0x26e46b8, mp=0x26e4610, abstime=
file=0x12389e0 "include/
at mysys/thr_
#2 0x0000000000842603 in inline_
src_
at include/
#3 0x00000000008444f0 in MDL_wait:
set_
at sql/mdl.cc:1160
#4 0x0000000000846705 in MDL_context:
lock_
#5 0x00000000008472e4 in MDL_context:
lock_
#6 0x0000000000605866 in wait_while_
function=
#7 0x00000000007a33b4 in mysql_alter_table (thd=0x26e4520, new_db=0x26f2708 "test", new_name=0x26f2108 "A",
create_
require_
#8 0x0000000000bc0117 in Alter_table_
at sql/sql_
#9 0x00000000006ad465 in mysql_execute_
#10 0x00000000006b22c1 in mysql_parse (thd=0x26e4520, rawbuf=0x26f2058 "ALTER TABLE A ADD INDEX (f)", length=27,
parser_
#11 0x000000000069dd4a in dispatch_command (command=COM_QUERY, thd=0x26e4520,
packet=
#12 0x000000000069c87a in do_command (thd=0x26e4520) at sql/sql_
#13 0x0000000000834a05 in do_handle_
#14 0x0000000000834212 in handle_
#15 0x00007fbe195fda4f in start_thread () from /lib64/
#16 0x00007fbe1839282d in clone () from /lib64/libc.so.6
#17 0x0000000000000000 in ?? ()
Thread 5 (Thread 21236):
#0 0x00007fbe1960538d in read () from /lib64/
#1 0x00000000011c2ee5 in vio_read (vio=0x26c7ad0, buf=0x26c7d40 "\a", size=4)
at vio/viosocket.c:72
#2 0x00000000005970be in my_real_read (net=0x25d7f78, complen=
at sql/net_serv.cc:840
#3 0x0000000000597af6 in my_net_read (net=0x25d7f78) at sql/net_
#4 0x000000000069c565 in do_command (thd=0x25d7c70) at sql/sql_
#5 0x0000000000834a05 in do_handle_
#6 0x0000000000834212 in handle_
#7 0x00007fbe195fda4f in start_thread () from /lib64/
#8 0x00007fbe1839282d in clone () from /lib64/libc.so.6
#9 0x0000000000000000 in ?? ()
Thread 4 (Thread 21233):
#0 0x00007fbe183896b3 in poll () from /lib64/libc.so.6
#1 0x000000000058c9b9 in handle_
#2 0x000000000058b5d8 in mysqld_main (argc=47, argv=0x24e1a50) at sql/mysqld.cc:4951
#3 0x000000000057d6d6 in main (argc=47, argv=0x7fffc29e
Thread 3 (Thread 21249):
#0 0x00007fbe19602709 in pthread_
#1 0x0000000001162be3 in safe_cond_timedwait (cond=0x272dc68, mp=0x272dbc0, abstime=
file=0x12389e0 "include/
at mysys/thr_
#2 0x0000000000842603 in inline_
src_
at include/
#3 0x00000000008444f0 in MDL_wait:
set_
at sql/mdl.cc:1160
#4 0x0000000000846705 in MDL_context:
lock_
#5 0x00000000008472e4 in MDL_context:
lock_
#6 0x0000000000605866 in wait_while_
function=
#7 0x00000000007a33b4 in mysql_alter_table (thd=0x272dad0, new_db=0x27fd0f8 "test", new_name=0x27fcaf8 "B",
create_
require_
#8 0x0000000000bc0117 in Alter_table_
at sql/sql_
#9 0x00000000006ad465 in mysql_execute_
#10 0x00000000006b22c1 in mysql_parse (thd=0x272dad0, rawbuf=0x27fca48 "ALTER TABLE B ADD INDEX (f)", length=27,
parser_
#11 0x000000000069dd4a in dispatch_command (command=COM_QUERY, thd=0x272dad0,
packet=
#12 0x000000000069c87a in do_command (thd=0x272dad0) at sql/sql_
#13 0x0000000000834a05 in do_handle_
#14 0x0000000000834212 in handle_
#15 0x00007fbe195fda4f in start_thread () from /lib64/
#16 0x00007fbe1839282d in clone () from /lib64/libc.so.6
#17 0x0000000000000000 in ?? ()
Thread 2 (Thread 21235):
#0 0x00007fbe19605ff7 in do_sigwait () from /lib64/
#1 0x00007fbe19606077 in sigwait () from /lib64/
#2 0x0000000000585f1f in signal_hand (arg=0x0) at sql/mysqld.cc:3012
#3 0x00007fbe195fda4f in start_thread () from /lib64/
#4 0x00007fbe1839282d in clone () from /lib64/libc.so.6
#5 0x0000000000000000 in ?? ()
Thread 1 (Thread 21251):
#0 0x00007fbe196035ec in pthread_kill () from /lib64/
#1 0x00000000011574fa in my_write_core (sig=6) at mysys/stacktrac
#2 0x0000000000958413 in handle_fatal_signal (sig=6) at sql/signal_
#3 <signal handler called>
#4 0x00007fbe182f49e5 in raise () from /lib64/libc.so.6
#5 0x00007fbe182f5ee6 in abort () from /lib64/libc.so.6
#6 0x00007fbe182ed235 in __assert_fail () from /lib64/libc.so.6
#7 0x000000000072f2d8 in join_read_
at sql/sql_
#8 0x00000000006fd421 in make_join_
at sql/sql_
#9 0x00000000006f18cd in JOIN::optimize (this=0x2803e80) at sql/sql_
#10 0x00000000006fbbc1 in mysql_select (thd=0x27feac0, rref_pointer_
fields=..., conds=0x2803c50, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_
result=
#11 0x00000000006ed66e in handle_select (thd=0x27feac0, lex=0x2800d88, result=0x2803e60, setup_tables_
at sql/sql_
#12 0x00000000006ae1da in execute_
at sql/sql_
#13 0x00000000006a21c8 in mysql_execute_
#14 0x00000000006b22c1 in mysql_parse (thd=0x27feac0,
rawbuf=
parser_
#15 0x000000000069dd4a in dispatch_command (command=COM_QUERY, thd=0x27feac0,
packet=
at sql/sql_
#16 0x000000000069c87a in do_command (thd=0x27feac0) at sql/sql_
#17 0x0000000000834a05 in do_handle_
#18 0x0000000000834212 in handle_
#19 0x00007fbe195fda4f in start_thread () from /lib64/
#20 0x00007fbe1839282d in clone () from /lib64/libc.so.6
maria-5.5
bzr version-info
revision-id: <email address hidden>
date: 2012-05-30 20:20:54 +0200
revno: 3425
With the provided RQG grammar, depending on the machine and luck, sometimes it takes several seconds, sometimes almost 10 minutes to get the failure, but I ran it numerous times, tried on 3 machines, and it always happened, sooner or later.
In all cases I built server as
cmake . -DCMAKE_
no other parameters.
Could not reproduce on maria-5.3.
# RQG grammar (1.yy):
thread1_init:
CREATE TABLE A (f INT) ENGINE=Aria; CREATE TABLE B (f INT) ENGINE=Aria; INSERT INTO B VALUES (6),(9)
thread1:
ALTER TABLE A ADD INDEX (f) ; DROP INDEX f ON A ;
thread2:
DROP INDEX f ON B ; ALTER TABLE B ADD INDEX (f) ;
query:
SELECT t1.f FROM A AS t1 LEFT JOIN table AS t2 ON 0 WHERE t1.f != _digit ;
table:
A | B ;
# End of RQG grammar
# Run as
perl runall.pl \
--threads=3 \
--duration=600 \
--queries=100M \
--grammar=1.yy \
--skip-gendata \
--basedir=<your basedir> \
--vardir=<your vardir>
Fixed and pushed into MariaDB 5.5 tree