Assertion failure on missing .ibd file

Bug #1434940 reported by Peiran Song
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Incomplete
Undecided
Unassigned
5.6
Incomplete
Undecided
Unassigned
5.7
Incomplete
Undecided
Unassigned

Bug Description

Server version: PS 5.5.31

A week ago, the customer tried to use ALTER TABLE temp.ledger_versioned IMPORT TABLESPACE; to import .ibd to a temp db, but ended up killed the process. Today when access the same name table at a different database, the server crashed with :

150322 1:36:49 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
150322 1:36:49 InnoDB: Fatal error: cannot open ./temp/ledger_versioned.ibd
.InnoDB: Have you deleted .ibd files under a running mysqld server?
150322 1:36:49 InnoDB: Assertion failure in thread 140387932489472 in file fil0fil.c line 721
InnoDB: Failing assertion: 0

For the completeness, I included error log data from a week ago when the initial complain on missing .ibd file was seen:

150314 20:48:15 [ERROR] MySQL is trying to open a table handle but the .ibd file for
table temp/ledger_versioned does not exist.
Have you deleted the .ibd file from the database directory under
the MySQL datadir, or have you used DISCARD TABLESPACE?
See http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html
how you can resolve the problem.

150314 20:48:45 InnoDB: cannot calculate statistics for table temp/ledger_versioned
InnoDB: because the .ibd file is missing. For help, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html
InnoDB: Import: The extended import of temp/ledger_versioned is being started.
InnoDB: Import: 3 indexes have been detected.
InnoDB: Progress in %: 1 2 3 4 5 6 7 8 9150314 20:57:18 InnoDB: cannot calculate statistics for table temp/ledger_versioned
InnoDB: because the .ibd file is missing. For help, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html
150314 20:57:18 [ERROR] MySQL is trying to open a table handle but the .ibd file for
table temp/ledger_versioned does not exist.
Have you deleted the .ibd file from the database directory under
the MySQL datadir, or have you used DISCARD TABLESPACE?
See http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html
how you can resolve the problem.
....

 55 56 57 58 59 60 61 62 63 64 65 66150314 22:05:25 InnoDB: cannot calculate statistics for table temp/ledger_versioned
InnoDB: because the .ibd file is missing. For help, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html
150314 22:05:25 [ERROR] MySQL is trying to open a table handle but the .ibd file for
table temp/ledger_versioned does not exist.
Have you deleted the .ibd file from the database directory under
the MySQL datadir, or have you used DISCARD TABLESPACE?
See http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html
how you can resolve the problem.

 93 94 95 96 97 98 99 100 done.
150322 1:36:49 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
150322 1:36:49 InnoDB: Fatal error: cannot open ./temp/ledger_versioned.ibd
.InnoDB: Have you deleted .ibd files under a running mysqld server?
150322 1:36:49 InnoDB: Assertion failure in thread 140387932489472 in file fil0fil.c line 721
InnoDB: Failing assertion: 0
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
01:36:49 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Please help us make Percona Server better by reporting any
bugs at http://bugs.percona.com/

key_buffer_size=268435456
read_buffer_size=131072
max_used_connections=476
max_threads=377
thread_count=291
connection_count=291
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 364498 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x111653250
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7fae9cd8be08 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x7b4965]
/usr/sbin/mysqld(handle_fatal_signal+0x4b4)[0x68f704]
/lib64/libpthread.so.0(+0xf5b0)[0x7fd9809655b0]
/lib64/libc.so.6(gsignal+0x39)[0x7fd97f454f49]
/lib64/libc.so.6(abort+0x148)[0x7fd97f456348]
/usr/sbin/mysqld[0x89cbc1]
/usr/sbin/mysqld[0x89cc39]
/usr/sbin/mysqld[0x8a8df4]
/usr/sbin/mysqld[0x879e7d]
/usr/sbin/mysqld[0x87a9c0]
/usr/sbin/mysqld[0x86c4a3]
/usr/sbin/mysqld[0x8aa8c6]
/usr/sbin/mysqld[0x8ace7e]
/usr/sbin/mysqld[0x7e0c3f]
/usr/sbin/mysqld[0x5d4a4e]
/usr/sbin/mysqld[0x5d568d]
/usr/sbin/mysqld(_Z14get_all_tablesP3THDP10TABLE_LISTP4Item+0x6cb)[0x5dff7b]
/usr/sbin/mysqld(_Z24get_schema_tables_resultP4JOIN23enum_schema_table_state+0x25e)[0x5cff6e]
/usr/sbin/mysqld(_ZN4JOIN4execEv+0x4dd)[0x5caa4d]
/usr/sbin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x12c)[0x5cc95c]
/usr/sbin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x1cd)[0x5cd40d]
/usr/sbin/mysqld[0x5895d2]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x1553)[0x58e2d3]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x33b)[0x591adb]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x163d)[0x5931bd]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x13f)[0x62e4cf]
/usr/sbin/mysqld(handle_one_connection+0x51)[0x62e5b1]
/usr/sbin/mysqld(pfs_spawn_thread+0x59)[0x7cd609]
/lib64/libpthread.so.0(+0x7f18)[0x7fd98095df18]
/lib64/libc.so.6(clone+0x6d)[0x7fd97f503e9d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fac98b22ff0): is an invalid pointer
Connection ID (thread ID): 1092584288
Status: NOT_KILLED

Tags: i52161
Revision history for this message
Peiran Song (peiran-song) wrote :

Here is the resolved stack trace:

stack_bottom = 7fae9cd8be08 thread_stack 0x30000
0x7b4965 my_print_stacktrace + 53
0x68f704 handle_fatal_signal + 1204
0x7fd9809655b0 _end + 2140204464
0x7fd97f454f49 _end + 2118117193
0x7fd97f456348 _end + 2118122312
0x89cbc1 fil_system_hash_nodes + 11185
0x89cc39 fil_system_hash_nodes + 11305
0x8a8df4 fil_space_set_corrupt + 30548
0x879e7d _ZN21ha_innobase_add_indexD0Ev + 583917
0x87a9c0 _ZN21ha_innobase_add_indexD0Ev + 586800
0x86c4a3 _ZN21ha_innobase_add_indexD0Ev + 528147
0x8aa8c6 fil_space_set_corrupt + 37414
0x8ace7e fil_space_set_corrupt + 47070
0x7e0c3f innobase_get_trx + 16319
0x5d4a4e _Z17append_identifierP3THDP6StringPKcj + 8446
0x5d568d _Z18view_store_optionsP3THDP10TABLE_LISTP6String + 1101
0x5dff7b _Z14get_all_tablesP3THDP10TABLE_LISTP4Item + 1739
0x5cff6e _Z24get_schema_tables_resultP4JOIN23enum_schema_table_state + 606
0x5caa4d _ZN4JOIN4execEv + 1245
0x5cc95c _Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select + 300
0x5cd40d _Z13handle_selectP3THDP3LEXP13select_resultm + 461
0x5895d2 _Z20check_routine_accessP3THDmPcS1_bb + 578
0x58e2d3 _Z21mysql_execute_commandP3THD + 5459
0x591adb _Z11mysql_parseP3THDPcjP12Parser_state + 827
0x5931bd _Z16dispatch_command19enum_server_commandP3THDPcj + 5693
0x62e4cf _Z24do_handle_one_connectionP3THD + 319
0x62e5b1 handle_one_connection + 81
0x7cd609 pfs_spawn_thread + 89
0x7fd98095df18 _end + 2140174104
0x7fd97f503e9d _end + 2118833821

tags: added: i52161
Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

Check http://bugs.mysql.com/bug.php?id=65199 about somewhat similar story. Ended up as "Not a bug" for upstream MySQL.

Can you present clear set of steps to end up with assertion failure like this? All these:

"... the customer tried to use ALTER TABLE temp.ledger_versioned IMPORT TABLESPACE; to import .ibd to a temp db, but ended up killed the process. Today when access the same name table at a different database..."

is far from clear, many things are missing. SHOW CREATE TABLE, ls -l in the database dir at each step etc. Full error log may be also useful, for the moment when import happened and until this assertion failure.

Revision history for this message
Peiran Song (peiran-song) wrote :

Thanks for referring to http://bugs.mysql.com/bug.php?id=65199. It is similar with differences, 1) the original case didn't involve server crash, 2)the last two cases that involves server crashed were caused by 'DROP TABLE'. In this case, the customer was accessing table sesame_db/ledger_versioned while the server complained about missing temp/ledger_versioned, and crashed.

The step that lead to the crash is: accessing sesame_db/ledger_versioned.

The import is mentioned as related information.

"ls -l in the database dir at each step etc": That data is not available. temp/ledger_versioned.frm is still there, per customer.

The error log can be considered full since import till the crash, the part skipped is just duplicated sections.

What do we know from the stack trace?

p.s. If the customer would agree to take this server out of production and try the drop table, we might get a core dump.

Revision history for this message
Sveta Smirnova (svetasmirnova) wrote :

Thank you for the feedback.

Stack trace shows that InnoDB tries to read all tables in database temp, then crashes. This is not enough to repeat the bug.

We need at least:

1. Query which customer issued when crash happened.
2. Output of SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE REFERENCED_TABLE_NAME='ledger_versioned'
3. Full error log file attached.

Revision history for this message
Peiran Song (peiran-song) wrote :

Thanks, Sveta. I have relayed the message to the customer.

We have the full error log at: https://customers.percona.com/download.php?cat=attachment&id=115057

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-3275

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.