Failing assertion: btr_pcur_restore_position(thr_get_trx(thr)->fake_changes ? BTR_SEARCH_TREE : BTR_MODIFY_TREE, pcur, mtr) [ in row_upd_clust_step / row_upd_clust_rec ]

Bug #1086269 reported by Roel Van de Paar
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Invalid
Undecided
Unassigned
5.1
Invalid
Undecided
Unassigned
5.5
Fix Released
High
Unassigned
5.6
Invalid
Undecided
Unassigned

Bug Description

Program terminated with signal 6, Aborted.
#0 0x00000038e260bd72 in pthread_kill () from /lib64/libpthread.so.0
(gdb) bt
+bt
#0 0x00000038e260bd72 in pthread_kill () from /lib64/libpthread.so.0
#1 0x0000000000695e23 in handle_fatal_signal (sig=6) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/signal_handler.cc:249
#2 <signal handler called>
#3 0x00000038e1630285 in raise () from /lib64/libc.so.6
#4 0x00000038e1631d30 in abort () from /lib64/libc.so.6
#5 0x000000000081d83a in row_upd_clust_rec (node=0x15e2e6f8, index=0x15a315a8, thr=0x1517cf20, mtr=0x15072830) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/storage/innobase/row/row0upd.c:2021
#6 0x000000000081dc1d in row_upd_clust_step (thr=<optimized out>, node=<optimized out>) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/storage/innobase/row/row0upd.c:2306
#7 row_upd (thr=<optimized out>, node=<optimized out>) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/storage/innobase/row/row0upd.c:2357
#8 row_upd_step (thr=0x1517cf20) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/storage/innobase/row/row0upd.c:2497
#9 0x0000000000807de1 in row_update_for_mysql (mysql_rec=<optimized out>, prebuilt=0x15e2cb58) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/
Percona-Server-5.5.28-rel29.1/storage/innobase/row/row0mysql.c:1505
#10 0x00000000007eab40 in ha_innobase::update_row (this=0x159eff80, old_row=0x15abe640 "\377\377\377?", new_row=0x15abe500 "\377\377\377?") at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/storage/innobase/handler/ha_innodb.cc:6333
#11 0x000000000069b6d5 in handler::ha_update_row (this=0x159eff80, old_data=0x15abe640 "\377\377\377?", new_data=0x15abe500 "\377\377\377?") at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/handler.cc:5386
#12 0x000000000056768a in write_record (thd=0x160e31c0, table=0x1afb1840, info=0x15073870) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/sql_insert.cc:1649
#13 0x000000000056e464 in mysql_insert (thd=0x160e31c0, table_list=0xe828938, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_UPDATE, ignore=false) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/sql_insert.cc:956
#14 0x000000000057ee0c in mysql_execute_command (thd=0x160e31c0) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/sql_parse.cc:3065
#15 0x0000000000583113 in mysql_parse (thd=0x160e31c0, rawbuf=<optimized out>, length=<optimized out>, parser_state=0x15074df0) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/sql_parse.cc:5811
#16 0x00000000005845da in dispatch_command (command=COM_QUERY, thd=0x160e31c0, packet=<optimized out>, packet_length=171) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/sql_parse.cc:1061
#17 0x0000000000584966 in do_command (thd=0x160e31c0) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/sql_parse.cc:788
#18 0x00000000006224c1 in do_handle_one_connection (thd_arg=<optimized out>) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/sql_connect.cc:1484
#19 0x00000000006225b4 in handle_one_connection (arg=<optimized out>) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/sql_connect.cc:1391
#20 0x00000038e260677d in start_thread () from /lib64/libpthread.so.0
#21 0x00000038e16d3c1d in clone () from /lib64/libc.so.6
#22 0x0000000000000000 in ?? ()
(gdb) frame 17
+frame 17
#17 0x0000000000584966 in do_command (thd=0x160e31c0) at /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/sql_parse.cc:788
788 /home/jenkins/workspace/percona-server-5.5-nigthly-binaries/label_exp/centos5-64/Percona-Server-5.5.28-rel29.1/sql/sql_parse.cc: No such file or directory.
(gdb) p thd->query_string.string.str
+p thd->query_string.string.str
$1 = 0xe8286a0 "INSERT INTO `table100_innodb_compressed_int` ( `c59` ) VALUES ( LOAD_FILE('/data/ssd/qa/randgen/data/earth11k.jpg') ) ON DUPLICATE KEY UPDATE `c11` = 2346093930883317760"

Tags: qa xtradb
Revision history for this message
Roel Van de Paar (roel11) wrote :

121204 7:45:06 InnoDB: Assertion failure in thread 352803136 in file row0upd.c line 2023
InnoDB: Failing assertion: btr_pcur_restore_position(thr_get_trx(thr)->fake_changes ? BTR_SEARCH_TREE : BTR_MODIFY_TREE, pcur, mtr)
InnoDB: We intentionally generate a memory trap.

Revision history for this message
Roel Van de Paar (roel11) wrote :

============= RQG script used:
$ cat cmd85
ps -ef | grep 'cmdrun_85' | grep -v grep | awk '{print $2}' | xargs sudo kill -9
rm -Rf /data/ssd/qa/105/cmdrun_85
mkdir /data/ssd/qa/105/cmdrun_85
cd /data/ssd/qa/105/randgen
bash -c "set -o pipefail; perl runall.pl --queries=100000000 --seed=1101 --duration=300 --querytimeout=60 --short_column_names --sqltrace --reporter=Shutdown,Backtrace,QueryTimeout,ErrorLog,ErrorLogAlarm --mysqld=--log-output=none --mysqld=--sql_mode=ONLY_FULL_GROUP_BY --grammar=conf/percona_qa/percona_qa.yy --gendata=conf/percona_qa/percona_qa.zz --basedir=/data/ssd/qa/105/Percona-Server-5.5.28-rel29.1-359.Linux.x86_64 --valgrind --reporter=ValgrindErrors --validator=MarkErrorLog --threads=1 --notnull --validator=Transformer --mysqld=--innodb_lazy_drop_table=1 --mysqld=--innodb_file_per_table=1 --mysqld=--innodb_file_format=barracuda --mtr-build-thread=781 --mask=8868 --vardir1=/data/ssd/qa/105/cmdrun_85 > /data/ssd/qa/105/cmdrun85.log 2>&1"

============= Versions:
PS: Percona-Server-5.5.28-rel29.1-359.Linux.x86_64
RQG: 794 <email address hidden>

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Does not look related to fake changes. Looks like a locking bug, needs further testcase reduction. It should be possible to reduce it to workload involving only table100_innodb_compressed_int and any its views if it is updated through them. Might be timing-dependent though.

Revision history for this message
Roel Van de Paar (roel11) wrote :

Just jotting down some notes. Bug confirmed reproducible using:

[roel@fusion1 102]$ cat cmd57
ps -ef | grep 'cmdrun_57' | grep -v grep | awk '{print $2}' | xargs sudo kill -9
rm -Rf /data/ssd/qa/102/cmdrun_57
mkdir /data/ssd/qa/102/cmdrun_57
cd /data/ssd/qa/102/randgen
bash -c "set -o pipefail; perl runall.pl --queries=100000000 --seed=24123 --duration=600 --querytimeout=60 --short_column_names --sqltrace --reporter=Shutdown,Backtrace,QueryTimeout,ErrorLog,ErrorLogAlarm --mysqld=--log-output=none --mysqld=--sql_mode=ONLY_FULL_GROUP_BY --grammar=conf/percona_qa/percona_qa.yy --gendata=conf/percona_qa/percona_qa.zz --basedir=/data/ssd/qa/102/Percona-Server-5.5.28-rel29.1-359.Linux.x86_64 --valgrind --reporter=ValgrindErrors --validator=MarkErrorLog --threads=1 --views --validator=Transformer --mysqld=--slow_query_log --mysqld=--innodb_lazy_drop_table=1 --mysqld=--innodb_file_per_table=1 --mtr-build-thread=757 --mask=57212 --vardir1=/data/ssd/qa/102/cmdrun_57 > /data/ssd/qa/102/cmdrun57.log 2>&1"[roel@fusion1 102]$ vi /data/ssd/qa/102/cmdrun57.log

RQG: 792 <email address hidden>

Possibly also using script in #2

Revision history for this message
Roel Van de Paar (roel11) wrote :
Revision history for this message
Roel Van de Paar (roel11) wrote :

This bug is seen quite often in RQG testing.

Revision history for this message
Roel Van de Paar (roel11) wrote :

Refined the testcase down to about 10 seconds. Testcase result:

================== Error log:
130122 5:06:49 [Note] /ssd/qa/102/Percona-Server-5.5.28-rel29.1-359.Linux.x86_64/bin/mysqld: ready for connections.
Version: '5.5.28-rel29.1-log' socket: '/ssd/qa/102/vardir1_57/tmp/master.sock' port: 11139 Percona Server with XtraDB (GPL), Release rel29.1, Revision 359
InnoDB: Warning: hash index ref_count (1) is not zero after fil_discard_tablespace().
index: "c32" table: "test/table100_innodb_compressed"
InnoDB: Warning: hash index ref_count (1) is not zero after fil_discard_tablespace().
index: "PRIMARY" table: "test/table100_innodb_default_int"
InnoDB: Warning: hash index ref_count (1) is not zero after fil_discard_tablespace().
index: "c32" table: "test/table100_innodb_compressed"
130122 5:07:10 InnoDB: Assertion failure in thread 67819264 in file row0upd.c line 2023
InnoDB: Failing assertion: btr_pcur_restore_position(thr_get_trx(thr)->fake_changes ? BTR_SEARCH_TREE : BTR_MODIFY_TREE, pcur, mtr)
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.
02:07:10 UTC - mysqld got signal 6 ;
==================

Note that both --innodb_file_per_table=1 and --innodb_lazy_drop_table=1 are required!

To execute the testcase:
1. Get PS (this was found on Percona-Server-5.5.28-rel29.1-359.Linux.x86_64)
2. Build with './build/build-binary.sh --debug ..', then untar
3. Set paths in start_mtr57 and test_mtr57 to the correct locations.
4. ./start_mtr57
5. time ./test_mtr57 # should complete in ~10 seconds. Crash data in vardir1_57

Sidenote; during testcase creation, I also saw the following happen at some point (note the 600 second timeout):

==================
InnoDB: Warning: hash index ref_count (1) is not zero after fil_discard_tablespace().
index: "PRIMARY" table: "test/table100_innodb_default_int"
InnoDB: Error: Waited for 5 secs for hash index ref_count (1) to drop to 0.
[...counts up to 600 seconds...]
InnoDB: Error: Waited for 600 secs for hash index ref_count (1) to drop to 0.
index: "PRIMARY" table: "test/table100_innodb_default_int"
130118 13:07:08 InnoDB: Assertion failure in thread 67819264 in file dict0dict.c line 1883
==================

Which in turn may relate to bug 1086227 / bug 897258 / bug 798371 (thanks AlexeyK)

Revision history for this message
Roel Van de Paar (roel11) wrote :
Revision history for this message
Roel Van de Paar (roel11) wrote :
tags: added: xtradb
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Should be fixed by the lazy drop table removal. Marking this as "Incomplete", so that it can be reopened in the case the crash resurfaces without the lazy drop table.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Revision history for this message
Roel Van de Paar (roel11) wrote :

Based on bug not showing anymore, set to fix released.

Revision history for this message
Roel Van de Paar (roel11) wrote :
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-2843

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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