fake-changes infinite loop on update, allocates many extents
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
High
|
Laurynas Biveinis | ||
5.1 |
Fix Released
|
High
|
Laurynas Biveinis | ||
5.5 |
Fix Released
|
High
|
Laurynas Biveinis |
Bug Description
With the fake-changes patch, a transaction that does an UPDATE with innodb_
The attached patch has two tests. The *bugs2 test reproduces the problem for update. The *bug3 test does not reproduce the problem for insert and it looks like cursor->tree_height is initialized when btr_cur_
Text from my patch:
Prevent space leaks when btr_cur_
cursor->tree_height and tree_height was not initialized. There are 1+
code paths (I found 1) by which this can happen. The workaround is
to hardwire the number of extents to reserve when it was not initialized.
When the new test is run tree_height is uninitialized on a few calls
to buf_cur_
but the variable was initialized without this change. The pessimistic
delete function is called for undo and purge -- neither of which can
be done with fake-changes.
This happens when btr_pcur_
or 2 because latch_mode was downgraded from a stronger level when
fake_changes=1. When latch_mode == 1 or 2, btr_pcur_
has a path to return before calling btr_pcur_
btr_cur_
btr_cur_
Note (1 == BTR_SEARCH_LEAF, 2 == BTR_MODIFY_LEAF, 33 == BTR_MODIFY_TREE).
The other problem is that btr_cur_
page_zip_
as a fake-change shouldn't write the transaction log (hopefully
it didn't change anything other than getting a few locks).
Related branches
- Stewart Smith (community): Approve
-
Diff: 395 lines (+288/-7)7 files modifiedPercona-Server/mysql-test/r/percona_innodb_fake_changes_bug_917942.result (+151/-0)
Percona-Server/mysql-test/t/percona_innodb_fake_changes_bug_917942-master.opt (+1/-0)
Percona-Server/mysql-test/t/percona_innodb_fake_changes_bug_917942.test (+103/-0)
Percona-Server/storage/innodb_plugin/btr/btr0cur.c (+28/-4)
Percona-Server/storage/innodb_plugin/btr/btr0pcur.c (+1/-0)
Percona-Server/storage/innodb_plugin/ibuf/ibuf0ibuf.c (+1/-1)
Percona-Server/storage/innodb_plugin/include/btr0cur.h (+3/-2)
- Stewart Smith (community): Approve
-
Diff: 563 lines (+363/-90)9 files modifiedPercona-Server/mysql-test/r/percona_innodb_fake_changes.result (+75/-0)
Percona-Server/mysql-test/r/percona_innodb_fake_changes_bug_917942.result (+151/-0)
Percona-Server/mysql-test/r/percona_innodb_fake_changes_locks.result (+0/-83)
Percona-Server/mysql-test/t/percona_innodb_fake_changes_bug_917942-master.opt (+1/-0)
Percona-Server/mysql-test/t/percona_innodb_fake_changes_bug_917942.test (+103/-0)
Percona-Server/storage/innobase/btr/btr0cur.c (+28/-4)
Percona-Server/storage/innobase/btr/btr0pcur.c (+1/-0)
Percona-Server/storage/innobase/ibuf/ibuf0ibuf.c (+1/-1)
Percona-Server/storage/innobase/include/btr0cur.h (+3/-2)
Changed in percona-server: | |
assignee: | nobody → Valentine Gostev (longbow) |
Changed in percona-server: | |
status: | New → Triaged |
importance: | Undecided → High |
tags: | added: contribution |
Current Percona Server 5.1 debug build crashes on percona_ innodb_ fake_changes_ bugs2.test this way:
121011 18:50:37 InnoDB: Assertion failure in thread 140724337829632 in file ./include/ mtr0log. ic line 192 contains_ page(mtr, ptr, 2)
InnoDB: Failing assertion: mtr_memo_
Thread 1 (Thread 0x7f5068343700 (LWP 21949)): <optimized out>, signo=<optimized out>) at ../nptl/ sysdeps/ unix/sysv/ linux/pthread_ kill.c: 63 handler. cc:249 sysdeps/ unix/sysv/ linux/raise. c:64 initial_ log_record_ fast (ptr=0x7f5063b64000 "", type=51 '3', log_ptr= 0x7f5068340810 "\a", mtr=0x7f50683405b0) at ./include/ mtr0log. ic:192 compress_ write_log (page_zip= 0x7f505bfd7188, page=0x7f5063b64000 "", index=0x7f50380 34198, mtr=0x7f50683405b0) at page/page0zip.c:351 0x7f505bfd7188, page=0x7f5063b64000 "", index=0x7f50380 34198, mtr=0x7f50683405b0) at page/page0zip. c:1445 update_ alloc_zip (page_zip= 0x7f505bfd7188, block=0x7f505bf d7178, index=0x7f50380 34198, length=6528, create=1, mtr=0x7f50683405b0) at btr/btr0cur.c:1781 optimistic_ update (flags=2, cursor= 0x7f50380158b8, update= 0x7f50380136f0, cmpl_info=1, thr=0x7f50380138f0, mtr=0x7f50683405b0) at btr/btr0cur.c:2062 135e8, index=0x7f50380 34198, thr=0x7f50380138f0, mtr=0x7f50683405b0) at row/row0upd.c:1970 135e8, thr=0x7f50380138f0) at row/row0upd.c:2251 135e8, thr=0x7f50380138f0) at row/row0upd.c:2331 38f0) at row/row0upd.c:2464 for_mysql (mysql_ rec=0x7f5038036 228 "\244", <incomplete sequence \310>, prebuilt= 0x7f503800add8) at row/row0mysql. c:1416 :update_ row (this=0x7f50380 35cf8, old_row= 0x7f5038036228 "\244", <incomplete sequence \310>, new_row= 0x7f5038036148 "\244", <incomplete sequence \310>) at handler/ ha_innodb. cc:5668 :ha_update_ row (this=0x7f50380 35cf8, old_data= 0x7f5038036228 "\244", <incomplete sequence \310>, new_data= 0x7f5038036148 "\244", <incomplete sequence \310>) at handler.cc:4837 31e08, info=0x7f506834 0de0) at sql_insert.cc:1520 0x7f5038004aa8, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_UPDATE, ignore=false) at sql_insert.cc:863 command (thd=0x2de19d8) at sql_parse.cc:3436 0x7f5038004908 "insert into t1 values (200, \"foo\", lpad(\...
#0 __pthread_kill (threadid=
#1 0x0000000000a70b3d in my_write_core (sig=6) at stacktrace.c:437
#2 0x00000000007c580e in handle_fatal_signal (sig=6) at signal_
#3 <signal handler called>
#4 0x00007f50693da445 in __GI_raise (sig=<optimized out>) at ../nptl/
#5 0x00007f50693ddbab in __GI_abort () at abort.c:91
#6 0x00000000008efd57 in mlog_write_
#7 0x0000000000904369 in page_zip_
#8 0x0000000000906b79 in page_zip_compress (page_zip=
#9 0x0000000000975bd2 in btr_cur_
#10 0x00000000009765cc in btr_cur_
#11 0x000000000093bafc in row_upd_clust_rec (node=0x7f50380
#12 0x000000000093c468 in row_upd_clust_step (node=0x7f50380
#13 0x000000000093c6b4 in row_upd (node=0x7f50380
#14 0x000000000093c9ac in row_upd_step (thr=0x7f503801
#15 0x000000000092656d in row_update_
#16 0x00000000008b8077 in ha_innobase:
#17 0x00000000007aff6c in handler:
#18 0x0000000000709812 in write_record (thd=0x2de19d8, table=0x7f50380
#19 0x0000000000707c02 in mysql_insert (thd=0x2de19d8, table_list=
#20 0x0000000000668503 in mysql_execute_
#21 0x0000000000671085 in mysql_parse (thd=0x2de19d8, rawbuf=