Assertion: prebuilt->sql_stat_start || trx->conc_state == 1 failed at row0sel.c:3933

Bug #922146 reported by Elena Stepanova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
High
Sergei Golubchik

Bug Description

120126 19:01:07 InnoDB: Assertion failure in thread 2787744624 in file row0sel.c line 3933
InnoDB: Failing assertion: prebuilt->sql_stat_start || trx->conc_state == 1

#6 0xb74667af in raise () from /lib/libc.so.6
#7 0xb74680f0 in abort () from /lib/libc.so.6
#8 0x08671d1b in row_search_for_mysql (buf=0x9d7e008 "\377\006", mode=2, prebuilt=0x9dacf80, match_mode=1, direction=0)
    at /home/elenst/maria-5.5/storage/xtradb/row/row0sel.c:3933
#9 0x086342de in ha_innobase::index_read (this=0x9d92f10, buf=0x9d7e008 "\377\006", key_ptr=0x9da3348 "\002", key_len=4,
    find_flag=HA_READ_KEY_EXACT) at /home/elenst/maria-5.5/storage/xtradb/handler/ha_innodb.cc:6546
#10 0x0863526c in ha_innobase::rnd_pos (this=0x9d92f10, buf=0x9d7e008 "\377\006", pos=0x9da3348 "\002")
    at /home/elenst/maria-5.5/storage/xtradb/handler/ha_innodb.cc:7050
#11 0x08869f01 in ha_partition::rnd_pos (this=0x9d9a788, buf=0x9d7e008 "\377\006", pos=0x9da3346 "\001")
    at /home/elenst/maria-5.5/sql/ha_partition.cc:4220
#12 0x0824a95f in handler::ha_rnd_pos (this=0x9d9a788, buf=0x9d7e008 "\377\006", pos=0x9da3346 "\001")
    at /home/elenst/maria-5.5/sql/sql_class.h:4233
#13 0x084f15c4 in rr_from_pointers (info=0xa6298724) at /home/elenst/maria-5.5/sql/records.cc:527
#14 0x08513621 in mysql_delete (thd=0x9dd3640, table_list=0x9de7dd8, conds=0x0, order_list=0x9dd51a0, limit=3, options=0)
    at /home/elenst/maria-5.5/sql/sql_delete.cc:327
#15 0x0825d860 in mysql_execute_command (thd=0x9dd3640) at /home/elenst/maria-5.5/sql/sql_parse.cc:3044
#16 0x08264ca8 in mysql_parse (thd=0x9dd3640,
    rawbuf=0x9de7c90 "DELETE LOW_PRIORITY IGNORE FROM t1 \nORDER BY col_char, col_char_key, col_int, col_int_key, pk \nLIMIT 3", length=103,
    parser_state=0xa6298db8) at /home/elenst/maria-5.5/sql/sql_parse.cc:5728
#17 0x0825913e in dispatch_command (command=COM_QUERY, thd=0x9dd3640,
    packet=0x9dd6079 "DELETE LOW_PRIORITY IGNORE FROM t1 \nORDER BY col_char, col_char_key, col_int, col_int_key, pk \nLIMIT 3",
    packet_length=103) at /home/elenst/maria-5.5/sql/sql_parse.cc:1054
#18 0x08258603 in do_command (thd=0x9dd3640) at /home/elenst/maria-5.5/sql/sql_parse.cc:793
#19 0x08341236 in do_handle_one_connection (thd_arg=0x9dd3640) at /home/elenst/maria-5.5/sql/sql_connect.cc:1252
#20 0x08340d84 in handle_one_connection (arg=0x9dd3640) at /home/elenst/maria-5.5/sql/sql_connect.cc:1167
#21 0x085621e9 in pfs_spawn_thread (arg=0x9da8ec8) at /home/elenst/maria-5.5/storage/perfschema/pfs.cc:1015
#22 0xb773eb25 in start_thread () from /lib/libpthread.so.0

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (9de7c90): DELETE LOW_PRIORITY IGNORE FROM t1 ORDER BY col_char, col_char_key, col_int, col_int_key, pk LIMIT 3
Connection ID (thread ID): 4
Status: NOT_KILLED

bzr version-info
revision-id: <email address hidden>
date: 2012-01-20 22:32:31 +0100
build-date: 2012-01-26 19:31:32 +0400
revno: 3228
branch-nick: maria-5.5

Couldn't reproduce on maria-5.3 or mysql-5.5.20, 5.6.4.
Also couldn't reproduce on Percona-Server-5.5.19, but possibly because it hits bug#916205 first. Sometimes it happens on maria-5.5 too.

The MTR test case provided below is non-deterministic. Sometimes it causes the assertion failure, sometimes not. It fails pretty often for me, but if you don't hit the failure, you might want to try the RQG test below. Again, it's not deterministic, sometimes it fails with the assertion in question, sometimes with bug#916205.

MTR test case:

--source include/have_innodb.inc

CREATE TABLE t1 (
 col_int_key INT,
 col_int INT,
 col_char CHAR(12),
 col_char_key CHAR(12),
 pk INT AUTO_INCREMENT,
 KEY (col_int_key),
 KEY (col_char_key),
 PRIMARY KEY (pk)
) ENGINE=InnoDB
PARTITION BY KEY(pk) PARTITIONS 2;
INSERT IGNORE INTO t1 VALUES
  (6, NULL, 'for', 'rwgfpndfo', NULL) ,
  (7, NULL, 'm', 'cant', NULL);
CREATE TABLE t2 (
 col_int_key INT,
 pk INT AUTO_INCREMENT,
 col_char_key CHAR(12),
 KEY (col_int_key),
 PRIMARY KEY (pk),
 KEY (col_char_key)
) ENGINE=InnoDB;

--connect (con1,127.0.0.1,root,,test)
--connect (con2,127.0.0.1,root,,test)

--connection con1
SET AUTOCOMMIT=OFF;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT col_int_key FROM t1
  WHERE col_int_key IN ( 122, 203, 317194240, 127 )
  LIMIT 8;

--connection con2
--send
DELETE LOW_PRIORITY IGNORE FROM t1
  ORDER BY col_char, col_char_key, col_int, col_int_key, pk
  LIMIT 3;
--connection con1
DELETE LOW_PRIORITY IGNORE FROM t1
  WHERE col_int_key IN ( 1, 5, 4017946624, 8, 1433993216 )
  ORDER BY col_char, col_char_key, col_int, col_int_key, pk
  LIMIT 2;
--connection con2
--reap

# End of MTR test case

# RQG test

perl runall.pl \
--duration=900 \
--queries=100M \
--mysqld=--innodb-lock-wait-timeout=3 \
--mysqld=--lock-wait-timeout=5 \
--grammar=conf/engines/engine_stress.yy \
--gendata=conf/engines/engine_stress.zz \
--engine=InnoDB \
--threads=64 \
--mysqld=--thread-handling=one-thread-per-connection \
--basedir1=<your basedir> \
--vardir1=<your vardir>

The grammar and data file here are from the randgen tree.

Related branches

Revision history for this message
Elena Stepanova (elenst) wrote :

Also filed in JIRA as MDEV-117

Elena Stepanova (elenst)
Changed in maria:
assignee: nobody → Sergei (sergii)
Changed in maria:
assignee: Sergei (sergii) → nobody
Revision history for this message
Elena Stepanova (elenst) wrote :

The MTR test case provided in the description does not fail for me on the current revno 3272, but this one does:

--source include/have_innodb.inc

SET GLOBAL innodb_lock_wait_timeout=3;

CREATE TABLE t1 (
 col_int_key INT,
 KEY (col_int_key)
) ENGINE=InnoDB
PARTITION BY KEY(col_int_key) PARTITIONS 2;
INSERT INTO t1 VALUES (6);

--connect (con1,127.0.0.1,root,,test)
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SET AUTOCOMMIT=OFF;
SELECT col_int_key FROM t1;

--connection default
--send
  DELETE IGNORE FROM t1;

--connection con1
DELETE FROM t1 WHERE col_int_key IN (1, 40000000);

--connection default
--reap

Tried Linux 32 bit, Linux 64 bit, Windows 32 bit, failed everywhere, on every attempt.

Changed in maria:
status: New → Fix Committed
assignee: nobody → Sergei (sergii)
importance: Undecided → High
Revision history for this message
Elena Stepanova (elenst) wrote :

Fix released with 5.5.21.

Changed in maria:
status: Fix Committed → Fix Released
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.