handle_fatal_signal (sig=11) in ha_innobase::check | handler/ha_innodb.cc:12244

Bug #1433197 reported by Ramesh Sivaraman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
High
Krunal Bauskar
5.1
Invalid
Undecided
Unassigned
5.5
Invalid
Undecided
Unassigned
5.6
Fix Released
High
Krunal Bauskar

Bug Description

** Testcase

DROP DATABASE test;CREATE DATABASE test;USE test;
set global innodb_trx_rseg_n_slots_debug=1;
CREATE TABLE t1(c1 INT,c2 CHAR (1),c3 INT(1),c4 CHAR (1) KEY,c5 INT UNIQUE KEY,c6 FIXED(0,0) DEFAULT 3.141592);
TRUNCATE TABLE test.t1;
INSERT INTO t1 SELECT a,b+32 FROM t1;
check TABLE t1;

** Extra startup option

--log-bin=binlog

The attached tarball gives the testcase as an exact match of our system, including some handy utilities

$ vi {epoch}_mybase # Update base path in this file (the only change
required!). For non-binary distribution please update SOURCE_DIR location also.
$ ./{epoch}_init # Initializes the data dir
$ ./{epoch}_start # Starts mysqld
$ ./{epoch}_cl # To check mysqld is up
$ ./{epoch}_run # Run the testcase with pquery binary(produces
output)
$ vi /dev/shm/{epoch}/error.log.out # Verify the error log
$ ./{epoch}_gdb # Brings you to a gdb prompt attached to correct
mysqld
& generated core
$ ./{epoch}_parse_core # Create {epoch}_STD.gdb and {epoch}_FULL.gdb;
standard and full var gdb stack traces
etc.

** GDB info

#0 0x00007fbb275bf771 in pthread_kill () from /lib64/libpthread.so.0
#1 0x0000000000abb48e in my_write_core (sig=11) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/mysys/stacktrace.c:422
#2 0x00000000007312c3 in handle_fatal_signal (sig=11) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/sql/signal_handler.cc:236
#3 <signal handler called>
#4 0x0000000000ae41df in ha_innobase::check (this=0x7fbb05849510, thd=0x7fbb15773000, check_opt=0x7fbb15776328) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/storage/innobase/handler/ha_innodb.cc:12244
#5 0x000000000064717d in handler::ha_check (this=0x7fbb05849510, thd=0x7fbb15773000, check_opt=0x7fbb15776328) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/sql/handler.cc:4287
#6 0x00000000009a3700 in mysql_admin_table(THD *, TABLE_LIST *, HA_CHECK_OPT *, const char *, thr_lock_type, bool, bool, uint, int (*)(THD *, TABLE_LIST *, HA_CHECK_OPT *), struct {...}, int (*)(THD *, TABLE_LIST *)) (thd=0x7fbb15773000, tables=0x7fbb0581f0e0, check_opt=0x7fbb15776328, operator_name=0xff13b4 "check", lock_type=TL_READ_NO_INSERT, open_for_modify=false, repair_table_use_frm=false, extra_open_options=32, prepare_func=0x0, operator_func=(int (handler::*)(handler * const, THD *, HA_CHECK_OPT *)) 0x647058 <handler::ha_check(THD*, st_ha_check_opt*)>, view_operator_func=0x885353 <view_checksum(THD*, TABLE_LIST*)>) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/sql/sql_admin.cc:654
#7 0x00000000009a502e in Sql_cmd_check_table::execute (this=0x7fbb0581f648, thd=0x7fbb15773000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/sql/sql_admin.cc:1108
#8 0x00000000007eb7f9 in mysql_execute_command (thd=0x7fbb15773000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/sql/sql_parse.cc:5445
#9 0x00000000007ef059 in mysql_parse (thd=0x7fbb15773000, rawbuf=0x7fbb0581f010 "check TABLE t1", length=14, parser_state=0x7fbb27b75df0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/sql/sql_parse.cc:6922
#10 0x00000000007e0ecf in dispatch_command (command=COM_QUERY, thd=0x7fbb15773000, packet=0x7fbb0eacb001 "", packet_length=14) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/sql/sql_parse.cc:1434
#11 0x00000000007dfded in do_command (thd=0x7fbb15773000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/sql/sql_parse.cc:1051
#12 0x00000000007a7d0d in do_handle_one_connection (thd_arg=0x7fbb15773000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/sql/sql_connect.cc:1532
#13 0x00000000007a7815 in handle_one_connection (arg=0x7fbb15773000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/sql/sql_connect.cc:1443
#14 0x0000000000dcc8c0 in pfs_spawn_thread (arg=0x7fbb20b40a20) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.23-72.1/storage/perfschema/pfs.cc:1860
#15 0x00007fbb275badf3 in start_thread () from /lib64/libpthread.so.0
#16 0x00007fbb262841ad in clone () from /lib64/libc.so.6

Tags: qa xtradb
Revision history for this message
Ramesh Sivaraman (rameshvs02) wrote :
tags: added: xtradb
Revision history for this message
Krunal Bauskar (krunal-bauskar) wrote :

ha_innobase::check() table api was using stale reference of table to check if table is corrupted.

Here is more easier way to understand it.

a. Truncate needs at-least 2 undo-slots to work. Anything less than it may cause truncate to fail. Truncate being ddl operation failure is non-recoverable (unless we do smart technique out-of-scope for now). This causes the table to mark as corrupt.
b. insert/dml operation post this will cause table to re-open which will invalidate the share->ib_table reference.
c. check table followed by this dml will have share->ib_table as invalid and so use of it will result in error.
Well failure of open should also invalidate the old handler instance that MySQL Server Layer is using for executing check table but that is different issue and may need to be fixed at generic level.

----------

Patch for this bug has been committed.

Pull Request: pr#144
Commit: 14d5d9a94f2cac1ae67afd8a806a0ed581530f7e (pr merge 5b15dc40cf96671f77ca0cd7ed81b967646e647d)

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-881

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.