incremental backup causes 5.5 to crash

Bug #893067 reported by Valentine Gostev
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Expired
Undecided
Unassigned

Bug Description

Bug report from mail list

it's my steps:
1. compile mysql and install it.
2. start mysql. and it's working.
3. do a full-backup with innobackup innobackupex $FULL-backup-PATH
4. load 1 warehouse data into mysql with Hammerora. When all data was
loaded into mysql, I do "select count(*)" from every tpcc tables, and
all were worked.
5. do a incremental backup.
innobackupex --incremental $FULL-backup-PATH --incremental-basedir=
$INCREMENTAL-backup-PATH
6. stop mysql
7. restore data:
innobackupex --apply-log --redo-only $FULL-backup-PATH
innobackupex --apply-log $FULL-backup-PATH --incremental-dir=
$INCREMENTAL-backup-PATH
innobackupex --copy-back $FULL-backup-PATH
8. restart mysql
9. do "select count(*)" from every tpcc tables again;
but this time, some select statements make mysql crash.

I have tried 3 different version of mysql: 5.5.10, 5.5.15, 5.5.16.

some error message from errlog of mysql:

111121 14:21:39 InnoDB: Assertion failure in thread 1222179136 in
file /root/projects/workspace/mysql-5.5.10/storage/innobase/btr/
btr0cur.c line 989
InnoDB: Failing assertion: index->id == btr_page_get_index_id(page)
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.

Changed in percona-xtrabackup:
assignee: nobody → Valentine Gostev (longbow)
importance: Undecided → High
Stewart Smith (stewart)
Changed in percona-xtrabackup:
assignee: Valentine Gostev (longbow) → nobody
Revision history for this message
Miguel Angel Nieto (miguelangelnieto) wrote :
Download full text (4.8 KiB)

I've repeated the process using PS 5.5.16-55 (binary package for Debian Squeeze) and XB 2.0.3. I've loaded 1 warehouse. This is the crash I get when I try to select the table order_line (other tables seems to work):

121126 13:44:31 - 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.

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

Thread pointer: 0x32428b0
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 = 0x7fb50d590e88 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x39)[0x7bd8c9]
/usr/sbin/mysqld(handle_segfault+0x464)[0x519884]
/lib/libpthread.so.0(+0xeff0)[0x7fb50d1a3ff0]
/lib/libc.so.6(gsignal+0x35)[0x7fb50c39f1b5]
/lib/libc.so.6(abort+0x180)[0x7fb50c3a1fc0]
/usr/sbin/mysqld[0x88d525]
/usr/sbin/mysqld[0x83d187]
/usr/sbin/mysqld[0x83dbc5]
/usr/sbin/mysqld[0x81579d]
/usr/sbin/mysqld[0x5b170d]
/usr/sbin/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0x79)[0x5ba529]
/usr/sbin/mysqld[0x5bb4d2]
/usr/sbin/mysqld(_ZN4JOIN4execEv+0xc40)[0x5d0bb0]
/usr/sbin/mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x12c)[0x5cc6ac]
/usr/sbin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x1cd)[0x5d23ad]
/usr/sbin/mysqld[0x58fb22]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x1236)[0x5935b6]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x313)[0x596df3]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x15a2)[0x598442]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0xdf)[0x631f7f]
/usr/sbin/mysqld(handle_one_connection+0x51)[0x6320b1]
/lib/libpthread.so.0(+0x68ca)[0x7fb50d19b8ca]
/lib/libc.so.6(clone+0x6d)[0x7fb50c43cb6d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x32d4740): select count(*) from order_line
Connection ID (thread ID): 1
Status: NOT_KILLED

SHOW TABLES also (sometimes) crashes the server:

121126 13:47:30 - mysqld got signal 11 ;
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.

key_buffer_size=16777216
read_buffer_size=131072
max_used_connection...

Read more...

Revision history for this message
Miguel Angel Nieto (miguelangelnieto) wrote :

Latest 5.5.28 also crashes after the restore:

12:58:50 UTC - mysqld got signal 11 ;
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=16777216
read_buffer_size=131072
max_used_connections=1
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 346810 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x34b69f0
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 = 7f8e3102be88 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x7c6d05]
/usr/sbin/mysqld(handle_fatal_signal+0x4a4)[0x696c44]
/lib/libpthread.so.0(+0xeff0)[0x7f8e30c3eff0]
/usr/sbin/mysqld[0x913216]
/usr/sbin/mysqld[0x864d20]
/usr/sbin/mysqld[0x89a79f]
/usr/sbin/mysqld[0x89e807]
/usr/sbin/mysqld[0x7f0e0b]
/usr/sbin/mysqld(_ZN7handler7ha_openEP5TABLEPKcii+0x3e)[0x69908e]
/usr/sbin/mysqld(_Z21open_table_from_shareP3THDP11TABLE_SHAREPKcjjjP5TABLEb+0x58c)[0x61270c]
/usr/sbin/mysqld(_Z10open_tableP3THDP10TABLE_LISTP11st_mem_rootP18Open_table_context+0xc53)[0x55fd83]
/usr/sbin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjjP19Prelocking_strategy+0x485)[0x560a95]
/usr/sbin/mysqld(_Z30open_normal_and_derived_tablesP3THDP10TABLE_LISTj+0x48)[0x561458]
/usr/sbin/mysqld(_Z18mysqld_list_fieldsP3THDP10TABLE_LISTPKc+0x25)[0x5e6955]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xaad)[0x59bafd]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0xdf)[0x638f5f]
/usr/sbin/mysqld(handle_one_connection+0x51)[0x639091]
/lib/libpthread.so.0(+0x68ca)[0x7f8e30c368ca]
/lib/libc.so.6(clone+0x6d)[0x7f8e2fed7b6d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (354c0d8):
Connection ID (thread ID): 1
Status: NOT_KILLED

And I think I've found the problem. If you have innodb_import_table_from_xtrabackup=1 on the my.cnf them mysqld crashes. If you do the --copy-back and start mysqld without that parameter on my.cnf, it works perfect.

So, the restore process crashes if innodb_import_table_from_xtrabackup is enabled.

Revision history for this message
Miguel Angel Nieto (miguelangelnieto) wrote :
Revision history for this message
Alexey Kopytov (akopytov) wrote :

Miguel,

Can you repeat the crash without xtrabackup, i.e. just starting the server with the tpcc database loaded and innodb_import_table_from_xtrabackup enabled in my.cnf? If so, the problem should be reported as a server bug.

Revision history for this message
Miguel Angel Nieto (miguelangelnieto) wrote :

The stacktrace of the core dump is attached.

Revision history for this message
Miguel Angel Nieto (miguelangelnieto) wrote :

Alexey:

I've started a clean PS instance with innodb_import_table_from_xtrabackup enabled. I've load the tpcc database of Hammerora with one warehouse and it works perfect. I can read each table even after service restart. No crashes at all.

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Thanks!

Revision history for this message
Vlad Lesin (vlad-lesin) wrote :

I tried to repeat this bug on the latest 2.1 and 2.0. I wrote test which repeats described steps and attached it to this post. There is no command line interface for HammerDB(new name for Hammerora). That is why there are two files in the test - before.sh which should be run before loading data and after.sh which is ran after that.

I tested it on latest Mysql trunk and on 5.5.10. As well I tested it on latest PS-5.5. The bug is not repeated.

no longer affects: percona-xtrabackup/2.0
no longer affects: percona-xtrabackup/2.1
Changed in percona-xtrabackup:
assignee: Vlad Lesin (vlad-lesin) → nobody
status: Triaged → Incomplete
milestone: 2.1.4 → none
Vlad Lesin (vlad-lesin)
Changed in percona-xtrabackup:
assignee: nobody → Vlad Lesin (vlad-lesin)
Vlad Lesin (vlad-lesin)
Changed in percona-xtrabackup:
assignee: Vlad Lesin (vlad-lesin) → nobody
Changed in percona-xtrabackup:
importance: High → Undecided
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Percona XtraBackup because there has been no activity for 60 days.]

Changed in percona-xtrabackup:
status: Incomplete → Expired
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/PXB-49

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/PXB-19

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.