Bug #74747 Failing assertion: index->id == btr_page_get_index_id(page) btr0cur.cc line 899
Submitted: 8 Nov 2014 7:20 Modified: 5 Feb 2015 7:55
Reporter: Roel Van de Paar Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S1 (Critical)
Version:5.6.20, 5.6.22, 5.7.5 OS:Any
Assigned to: CPU Architecture:Any

[8 Nov 2014 7:20] Roel Van de Paar
Description:
Version: '5.6.20-debug'  socket: '/sda/mysql-5.6.20-linux-x86_64-debug/socket.sock'  port: 17011  MySQL Community Server (GPL)
2014-11-09 04:14:09 7f295c5ef700  InnoDB: Warning: cannot find a free slot for an undo log. Do you have too
InnoDB: many active transactions running concurrently?
2014-11-09 04:14:10 7f295c5ef700  InnoDB: Warning: cannot find a free slot for an undo log. Do you have too
InnoDB: many active transactions running concurrently?
2014-11-09 04:14:10 7f2959da1700  InnoDB: Warning: cannot find a free slot for an undo log. Do you have too
InnoDB: many active transactions running concurrently?
2014-11-09 04:14:10 7f2959da1700 InnoDB: Cannot save table statistics for table "db1"."t1": Too many concurrent transactions
2014-11-09 04:14:10 7f295c5ef700  InnoDB: Warning: cannot find a free slot for an undo log. Do you have too
InnoDB: many active transactions running concurrently?
2014-11-09 04:14:10 29202 [Warning] InnoDB: Unable to delete statistics for table db1.t1: Too many concurrent transactions. They can be deleted later using DELETE FROM mysql.innodb_index_stats WHERE database_name = 'db1' AND table_name = 't1'; DELETE FROM mysql.innodb_table_stats WHERE database_name = 'db1' AND table_name = 't1';
2014-11-09 04:14:10 7f295c5ef700  InnoDB: Warning: cannot find a free slot for an undo log. Do you have too
InnoDB: many active transactions running concurrently?
2014-11-09 04:14:10 7f295c5ef700InnoDB: unknown error code 47 while dropping table:`db1`.`t1`.
2014-11-09 04:14:10 7f295c5ef700  InnoDB: Assertion failure in thread 139815620114176 in file btr0cur.cc line 899
InnoDB: Failing assertion: index->id == btr_page_get_index_id(page)
[...]
Query (7f293c004ff0): SELECT COUNT(*)FROM t1 WHERE c1=0
Connection ID (thread ID): 1
Status: NOT_KILLED

(gdb) bt
#0  0x00007f29f27f2771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000a9035e in my_write_core (sig=6) at /bzr/mysql-5.6/mysys/stacktrace.c:422
#2  0x0000000000723688 in handle_fatal_signal (sig=6) at /bzr/mysql-5.6/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00007f29f15fe5c9 in raise () from /lib64/libc.so.6
#5  0x00007f29f15ffcd8 in abort () from /lib64/libc.so.6
#6  0x0000000000d12184 in btr_cur_open_at_index_side_func (from_left=true, index=0x7f293c071168, latch_mode=1, cursor=0x7f293c08aab0, level=0, file=0x1027b40 "/bzr/mysql-5.6/storage/innobase/include/btr0pcur.ic", line=518, mtr=0x7f295c5ec150) at /bzr/mysql-5.6/storage/innobase/btr/btr0cur.cc:899
#7  0x0000000000c82b88 in btr_pcur_open_at_index_side (from_left=true, index=0x7f293c071168, latch_mode=1, pcur=0x7f293c08aab0, init_pcur=false, level=0, mtr=0x7f295c5ec150) at /bzr/mysql-5.6/storage/innobase/include/btr0pcur.ic:518
#8  0x0000000000c8a993 in row_search_for_mysql (buf=0x7f293c0b93b0 "\377", mode=1, prebuilt=0x7f293c08aa38, match_mode=0, direction=0) at /bzr/mysql-5.6/storage/innobase/row/row0sel.cc:4178
#9  0x0000000000b69f1e in ha_innobase::index_read (this=0x7f293c076940, buf=0x7f293c0b93b0 "\377", key_ptr=0x0, key_len=0, find_flag=HA_READ_AFTER_KEY) at /bzr/mysql-5.6/storage/innobase/handler/ha_innodb.cc:7507
#10 0x0000000000b6ac18 in ha_innobase::index_first (this=0x7f293c076940, buf=0x7f293c0b93b0 "\377") at /bzr/mysql-5.6/storage/innobase/handler/ha_innodb.cc:7874
#11 0x0000000000b6ae10 in ha_innobase::rnd_next (this=0x7f293c076940, buf=0x7f293c0b93b0 "\377") at /bzr/mysql-5.6/storage/innobase/handler/ha_innodb.cc:7971
#12 0x00000000006384d8 in handler::ha_rnd_next (this=0x7f293c076940, buf=0x7f293c0b93b0 "\377") at /bzr/mysql-5.6/sql/handler.cc:2687
#13 0x000000000097676a in rr_sequential (info=0x7f293c006d78) at /bzr/mysql-5.6/sql/records.cc:478
#14 0x00000000007a2e15 in join_init_read_record (tab=0x7f293c006ce8) at /bzr/mysql-5.6/sql/sql_executor.cc:2395
#15 0x00000000007a061b in sub_select (join=0x7f293c005c70, join_tab=0x7f293c006ce8, end_of_records=false) at /bzr/mysql-5.6/sql/sql_executor.cc:1256
#16 0x00000000007a0005 in do_select (join=0x7f293c005c70) at /bzr/mysql-5.6/sql/sql_executor.cc:933
#17 0x000000000079df61 in JOIN::exec (this=0x7f293c005c70) at /bzr/mysql-5.6/sql/sql_executor.cc:194
#18 0x00000000007fe143 in mysql_execute_select (thd=0x29b60c0, select_lex=0x29b8938, free_join=true) at /bzr/mysql-5.6/sql/sql_select.cc:1100
#19 0x00000000007fe43f in mysql_select (thd=0x29b60c0, tables=0x7f293c0052e0, wild_num=0, fields=..., conds=0x7f293c005a10, order=0x29b8b00, group=0x29b8a38, having=0x0, select_options=2147748608, result=0x7f293c005c48, unit=0x29b82f0, select_lex=0x29b8938) at /bzr/mysql-5.6/sql/sql_select.cc:1221
#20 0x00000000007fc4c7 in handle_select (thd=0x29b60c0, result=0x7f293c005c48, setup_tables_done_option=0) at /bzr/mysql-5.6/sql/sql_select.cc:110
#21 0x00000000007d681b in execute_sqlcom_select (thd=0x29b60c0, all_tables=0x7f293c0052e0) at /bzr/mysql-5.6/sql/sql_parse.cc:5103
#22 0x00000000007cf5cb in mysql_execute_command (thd=0x29b60c0) at /bzr/mysql-5.6/sql/sql_parse.cc:2649
#23 0x00000000007d8fa4 in mysql_parse (thd=0x29b60c0, rawbuf=0x7f293c004ff0 "SELECT COUNT(*)FROM t1 WHERE c1=0", length=33, parser_state=0x7f295c5edeb0) at /bzr/mysql-5.6/sql/sql_parse.cc:6245
#24 0x00000000007cc557 in dispatch_command (command=COM_QUERY, thd=0x29b60c0, packet=0x86556e1 "", packet_length=33) at /bzr/mysql-5.6/sql/sql_parse.cc:1332
#25 0x00000000007cb646 in do_command (thd=0x29b60c0) at /bzr/mysql-5.6/sql/sql_parse.cc:1034
#26 0x0000000000793a61 in do_handle_one_connection (thd_arg=0x29b60c0) at /bzr/mysql-5.6/sql/sql_connect.cc:982
#27 0x000000000079354a in handle_one_connection (arg=0x29b60c0) at /bzr/mysql-5.6/sql/sql_connect.cc:898
#28 0x0000000000ade888 in pfs_spawn_thread (arg=0x850f250) at /bzr/mysql-5.6/storage/perfschema/pfs.cc:1860
#29 0x00007f29f27eddf3 in start_thread () from /lib64/libpthread.so.0
#30 0x00007f29f16bf01d in clone () from /lib64/libc.so.6

How to repeat:
SOURCE attached_testcase.sql
[8 Nov 2014 7:21] Roel Van de Paar
Testcase

Attachment: attached_testcase.sql (application/octet-stream, text), 2.74 KiB.

[8 Nov 2014 7:30] Roel Van de Paar
This was https://bugs.launchpad.net/mysql-server/+bug/1384596
[8 Nov 2014 9:05] MySQL Verification Team
Hello Roel,

Thank you for the bug report and test case.
Confirmed with 5.6.22 that only debug build is affected.

Thanks,
Umesh
[8 Nov 2014 9:05] MySQL Verification Team
// 5.6.22

(gdb) bt
#0  0x0000003deb00c8ac in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000b0011b in my_write_core (sig=6) at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/mysys/stacktrace.c:422
#2  0x000000000077ecb8 in handle_fatal_signal (sig=6) at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x0000003deac32625 in raise () from /lib64/libc.so.6
#5  0x0000003deac33e05 in abort () from /lib64/libc.so.6
#6  0x0000000000d4508b in btr_cur_open_at_index_side_func (from_left=true, index=0x7fef280b8348, latch_mode=1, cursor=0x7fef28018360, level=0,
    file=0x114afb8 "/pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/storage/innobase/include/btr0pcur.ic", line=518, mtr=0x7fef57d4d2e0)
    at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/storage/innobase/btr/btr0cur.cc:899
#7  0x0000000000cb4773 in btr_pcur_open_at_index_side (from_left=true, index=0x7fef280b8348, latch_mode=1, pcur=0x7fef28018360, init_pcur=false, level=0, mtr=0x7fef57d4d2e0)
    at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/storage/innobase/include/btr0pcur.ic:518
#8  0x0000000000cbc746 in row_search_for_mysql (buf=0x7fef28034568 "\377", mode=1, prebuilt=0x7fef280182e8, match_mode=0, direction=0)
    at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/storage/innobase/row/row0sel.cc:4174
#9  0x0000000000b9aa7d in ha_innobase::index_read (this=0x7fef280342a0, buf=0x7fef28034568 "\377", key_ptr=0x0, key_len=0, find_flag=HA_READ_AFTER_KEY)
    at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/storage/innobase/handler/ha_innodb.cc:7549
#10 0x0000000000b9b788 in ha_innobase::index_first (this=0x7fef280342a0, buf=0x7fef28034568 "\377")
    at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/storage/innobase/handler/ha_innodb.cc:7916
#11 0x0000000000b9b981 in ha_innobase::rnd_next (this=0x7fef280342a0, buf=0x7fef28034568 "\377")
    at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/storage/innobase/handler/ha_innodb.cc:8013
#12 0x000000000068fc43 in handler::ha_rnd_next (this=0x7fef280342a0, buf=0x7fef28034568 "\377") at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/sql/handler.cc:2687
#13 0x00000000008a5c7d in mysql_checksum_table (thd=0x28d8770, tables=0x7fef280050c8, check_opt=0x28db698) at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/sql/sql_table.cc:9237
#14 0x000000000082f6a3 in mysql_execute_command (thd=0x28d8770) at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/sql/sql_parse.cc:3277
#15 0x00000000008380e1 in mysql_parse (thd=0x28d8770, rawbuf=0x7fef28004fd0 "checksum table t1,t2,t3,t4 extended", length=35, parser_state=0x7fef57d4f680)
    at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/sql/sql_parse.cc:6357
#16 0x000000000082aa63 in dispatch_command (command=COM_QUERY, thd=0x28d8770, packet=0x2a075b1 "", packet_length=35)
    at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/sql/sql_parse.cc:1332
#17 0x0000000000829ac8 in do_command (thd=0x28d8770) at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/sql/sql_parse.cc:1034
#18 0x00000000007f0f17 in do_handle_one_connection (thd_arg=0x28d8770) at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/sql/sql_connect.cc:982
#19 0x00000000007f09e8 in handle_one_connection (arg=0x28d8770) at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/sql/sql_connect.cc:898
#20 0x0000000000e64c25 in pfs_spawn_thread (arg=0x29cace0) at /pb2/build/sb_0-13562263-1414689457.82/mysqlcom-pro-5.6.22/storage/perfschema/pfs.cc:1860
#21 0x0000003deb0079d1 in start_thread () from /lib64/libpthread.so.0
#22 0x0000003deace89dd in clone () from /lib64/libc.so.6
[8 Nov 2014 9:06] MySQL Verification Team
// 5.7.6 builds doesn't seems to be affected
[3 Feb 2015 5:52] Roel Van de Paar
Asserts 5.7.5-m15

DROP DATABASE transforms;CREATE DATABASE transforms;DROP DATABASE test;CREATE DATABASE test;USE test;
SET @@global.innodb_trx_rseg_n_slots_debug = 1;
CREATE TABLE t1(c1 INT);
DROP TABLE t1;
ALTER TABLE t1 ADD CONSTRAINT UNIQUE INDEX (c1);

2015-02-03T05:47:18.906970Z 0 [Note] /sda/MS-mysql-5.7.5-m15-linux-x86_64-debug/bin/mysqld: ready for connections.
Version: '5.7.5-m15-debug'  socket: '/sda/MS-mysql-5.7.5-m15-linux-x86_64-debug/socket.sock'  port: 16633  MySQL Community Server (GPL)
2015-02-03T05:47:35.653550Z 1 [Warning] InnoDB: Cannot find a free slot for an undo log. Do you have too many active transactions running concurrently?
2015-02-03T05:47:35.653594Z 1 [Warning] InnoDB: Unable to delete statistics for table test.t1: Too many concurrent transactions. They can be deleted later using DELETE FROM mysql.innodb_index_stats WHERE database_name = 'test' AND table_name = 't1'; DELETE FROM mysql.innodb_table_stats WHERE database_name = 'test' AND table_name = 't1';
2015-02-03T05:47:35.654468Z 1 [Warning] InnoDB: Cannot find a free slot for an undo log. Do you have too many active transactions running concurrently?
2015-02-03T05:47:35.654508Z 1 [ERROR] InnoDB: Unknown error code 47 while dropping table: `test`.`t1`.
2015-02-03 16:47:36 0x7fbded4dc700  InnoDB: Assertion failure in thread 140453706843904 in file btr0cur.cc line 2208
InnoDB: Failing assertion: index->id == btr_page_get_index_id(page)
[5 Feb 2015 7:55] Roel Van de Paar
Another testcase, tested to crash 5.7.5-m15

2015-02-05T07:51:40.515584Z 0 [Note] /sda/MS-mysql-5.7.5-m15-linux-x86_64-debug/bin/mysqld: ready for connections.
Version: '5.7.5-m15-debug'  socket: '/sda/MS-mysql-5.7.5-m15-linux-x86_64-debug/socket.sock'  port: 16633  MySQL Community Server (GPL)
2015-02-05T07:51:42.811781Z 1 [Warning] InnoDB: Cannot find a free slot for an undo log. Do you have too many active transactions running concurrently?
2015-02-05T07:51:42.811833Z 1 [Warning] InnoDB: Unable to delete statistics for table test.t1: Too many concurrent transactions. They can be deleted later using
 DELETE FROM mysql.innodb_index_stats WHERE database_name = 'test' AND table_name = 't1'; DELETE FROM mysql.innodb_table_stats WHERE database_name = 'test' AND
table_name = 't1';
2015-02-05T07:51:42.812642Z 1 [Warning] InnoDB: Cannot find a free slot for an undo log. Do you have too many active transactions running concurrently?
2015-02-05T07:51:42.812682Z 1 [ERROR] InnoDB: Unknown error code 47 while dropping table: `test`.`t1`.
2015-02-05 18:51:43 0x7f2b3d8d0700  InnoDB: Assertion failure in thread 139823692973824 in file btr0cur.cc line 1244
InnoDB: Failing assertion: index->id == btr_page_get_index_id(page)

DROP DATABASE transforms;CREATE DATABASE transforms;DROP DATABASE test;CREATE DATABASE test;USE test;
set global innodb_file_per_table=off;
set global innodb_trx_rseg_n_slots_debug=1;
CREATE TABLE m3(c1 DECIMAL,c2 BINARY (25),c3 INT(4),c4 VARBINARY(15) KEY,c5 DECIMAL UNIQUE KEY,c6 NUMERIC(0,0) DEFAULT 3.141592);
CREATE TABLE t1(s1 CHAR (5)CHARACTER SET ucs2,s2 VARCHAR(5) CHARACTER SET utf16le);
DROP TABLES t1,t3;
CREATE TABLE t17(c1 CHAR (10));
INSERT INTO t1 VALUES(0,0);