[MDEV-4945] Assertion prebuilt->trx->state == 1 fails in ha_innodb.cc on concurrent DML Created: 2013-08-25  Updated: 2014-11-16  Resolved: 2014-11-16

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 5.5.32
Fix Version/s: 5.5.37

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: upstream

Issue Links:
Relates

 Description   

It's an upstream bug (Oracle, Percona), but I keep running into it and jumping into investigating, so I'll file it here to be able to find it faster next time

130825 21:17:59  InnoDB: Assertion failure in thread 140072421771008 in file ha_innodb.cc line 6689
InnoDB: Failing assertion: prebuilt->trx->state == 1

#5  0x00007f6525a2bb8b in __GI_abort () at abort.c:91
#6  0x0000000000ac3efa in ha_innobase::unlock_row (this=0x7f64ac0a1a68) at 5.5/storage/xtradb/handler/ha_innodb.cc:6689
#7  0x00000000007c6af1 in find_all_keys (param=0x7f6526f11e90, select=0x7f649c017c28, sort_keys=0x7f649c0190b0, sort_keys_buf=0x7f649c01afb0 "\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245\245"..., buffpek_pointers=0x7f6526f12190, tempfile=0x7f6526f12000) at 5.5/sql/filesort.cc:656
#8  0x00000000007c5559 in filesort (thd=0x3d33a80, table=0x7f64ac09a810, sortorder=0x7f649c011408, s_length=2, select=0x7f649c017c28, max_rows=18446744073709551615, sort_positions=true, examined_rows=0x7f6526f12498) at 5.5/sql/filesort.cc:240
#9  0x0000000000916cf9 in mysql_delete (thd=0x3d33a80, table_list=0x7f649c005338, conds=0x7f649c00fd20, order_list=0x3d37698, limit=1, options=0) at 5.5/sql/sql_delete.cc:269
#10 0x0000000000611f92 in mysql_execute_command (thd=0x3d33a80) at 5.5/sql/sql_parse.cc:3076
#11 0x0000000000619990 in mysql_parse (thd=0x3d33a80, rawbuf=0x7f649c0051c8 "DELETE FROM `t2` WHERE `i` IN ( SELECT `i` FROM `t1` WHERE `i` = 3 ) ORDER BY `i`, `j` LIMIT 1", length=94, parser_state=0x7f6526f13550) at 5.5/sql/sql_parse.cc:5769
#12 0x000000000060d009 in dispatch_command (command=COM_QUERY, thd=0x3d33a80, packet=0x3d39ee1 "DELETE FROM `t2` WHERE `i` IN ( SELECT `i` FROM `t1` WHERE `i` = 3 ) ORDER BY `i`, `j` LIMIT 1", packet_length=94) at 5.5/sql/sql_parse.cc:1071
#13 0x000000000060c219 in do_command (thd=0x3d33a80) at 5.5/sql/sql_parse.cc:794
#14 0x0000000000713545 in do_handle_one_connection (thd_arg=0x3d33a80) at 5.5/sql/sql_connect.cc:1266
#15 0x0000000000712f2c in handle_one_connection (arg=0x3d33a80) at 5.5/sql/sql_connect.cc:1181
#16 0x00007f65267f1e9a in start_thread (arg=0x7f6526f14700) at pthread_create.c:308
#17 0x00007f6525ae5cbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

revision-id: igor@askmonty.org-20130823153435-h0x3db9sjxsov8uc
revno: 3860
branch-nick: 5.5

RQG grammar:

query_init:
 CREATE TABLE IF NOT EXISTS `t1` (`i` INT, `j` INT, KEY(`i`)) ENGINE=InnoDB
 ; CREATE TABLE IF NOT EXISTS `t2` (`i` INT, `j` INT, KEY(`i`)) ENGINE=InnoDB ;
 
query:
 INSERT INTO _table ( `i`, `j` ) VALUES ( _digit , _digit ) , ( _digit , _digit ) |
 DELETE FROM _table WHERE `i` IN ( SELECT `i` FROM _table WHERE `i` = _digit ) ORDER BY `i`, `j` LIMIT 1;
 
_table:
 `t1` | `t2` ;

RQG command lines:

./gentest.pl --threads=8 --duration=1200 --queries=100M --grammar=1.yy --dsn=dbi:mysql:host=127.0.0.1:port=9306:user=root:database=test

perl ./runall-new.pl --threads=8 --duration=1200 --queries=100M --grammar=1.yy --skip-gendata --basedir=<basedir> --vardir=<vardir>



 Comments   
Comment by Elena Stepanova [ 2014-11-16 ]

The upstream bugs are said to have been fixed in 5.5.37; I can't reproduce the problem even on MariaDB 5.5.36 (easily reproducible on 5.5.35). Thus, closing as fixed.

Generated at Thu Feb 08 07:00:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.