handle_fatal_signal (sig=6) in row_ins_index_entry_set_vals

Bug #1628751 reported by Roel Van de Paar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Triaged
High
Unassigned
5.6
New
Undecided
Unassigned
5.7
New
Undecided
Unassigned

Bug Description

+bt
#0 0x00007ff3c8961741 in __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1 0x00000000007f9f18 in my_write_core (sig=6) at /git/PS-5.5.52_dbg/mysys/stacktrace.c:433
#2 0x00000000006b9c56 in handle_fatal_signal (sig=6) at /git/PS-5.5.52_dbg/sql/signal_handler.cc:250
#3 <signal handler called>
#4 0x00007ff3c71165f7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#5 0x00007ff3c7117ce8 in __GI_abort () at abort.c:90
#6 0x0000000000a2d376 in row_ins_index_entry_set_vals (row=0x7ff3b011e1a0, entry=0x0, index=0x7ff3b0026c78) at /git/PS-5.5.52_dbg/storage/innobase/row/row0ins.c:2333
#7 row_ins_index_entry_step (thr=0x7ff3b011e300, node=0x7ff3b011e0e0) at /git/PS-5.5.52_dbg/storage/innobase/row/row0ins.c:2386
#8 row_ins (thr=0x7ff3b011e300, node=0x7ff3b011e0e0) at /git/PS-5.5.52_dbg/storage/innobase/row/row0ins.c:2522
#9 row_ins_step (thr=thr@entry=0x7ff3b011e300) at /git/PS-5.5.52_dbg/storage/innobase/row/row0ins.c:2639
#10 0x000000000089a000 in row_insert_for_mysql (mysql_rec=<optimized out>, prebuilt=0x7ff3b011dc78) at /git/PS-5.5.52_dbg/storage/innobase/row/row0mysql.c:1252
#11 0x0000000000876088 in ha_innobase::write_row (this=0x7ff3b0034010, record=0x7ff3b0044c10 "\375\002") at /git/PS-5.5.52_dbg/storage/innobase/handler/ha_innodb.cc:6200
#12 0x00000000006c2f59 in handler::ha_write_row (this=0x7ff3b0034010, buf=0x7ff3b0044c10 "\375\002") at /git/PS-5.5.52_dbg/sql/handler.cc:5464
#13 0x0000000000580482 in write_record (thd=thd@entry=0x7ff3ba3c1000, table=table@entry=0x7ff3b011ce00, info=info@entry=0x7ff3c8f544a0) at /git/PS-5.5.52_dbg/sql/sql_insert.cc:1797
#14 0x00000000005843bc in mysql_insert (thd=thd@entry=0x7ff3ba3c1000, table_list=0x7ff3b001f0f8, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /git/PS-5.5.52_dbg/sql/sql_insert.cc:955
#15 0x0000000000598ea1 in mysql_execute_command (thd=thd@entry=0x7ff3ba3c1000) at /git/PS-5.5.52_dbg/sql/sql_parse.cc:3179
#16 0x000000000059df56 in mysql_parse (thd=thd@entry=0x7ff3ba3c1000, rawbuf=<optimized out>, length=24, parser_state=parser_state@entry=0x7ff3c8f55520) at /git/PS-5.5.52_dbg/sql/sql_parse.cc:6062
#17 0x000000000059f954 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7ff3ba3c1000, packet=packet@entry=0x7ff3ba394001 "INSERT INTO t1 VALUES(2)", packet_length=packet_length@entry=24) at /git/PS-5.5.52_dbg/sql/sql_parse.cc:1075
#18 0x00000000005a1825 in do_command (thd=0x7ff3ba3c1000) at /git/PS-5.5.52_dbg/sql/sql_parse.cc:789
#19 0x00000000006500d4 in do_handle_one_connection (thd_arg=thd_arg@entry=0x7ff3ba3c1000) at /git/PS-5.5.52_dbg/sql/sql_connect.cc:1418
#20 0x00000000006501ca in handle_one_connection (arg=0x7ff3ba3c1000) at /git/PS-5.5.52_dbg/sql/sql_connect.cc:1325
#21 0x00007ff3c895cdc5 in start_thread (arg=0x7ff3c8f56700) at pthread_create.c:308
#22 0x00007ff3c71d7ced in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

==================

160929 12:45:46 [Note] /sda/PS280916-percona-server-5.5.52-38.3-linux-x86_64-debug/bin/mysqld: ready for connections.
Version: '5.5.52-38.3-debug' socket: '/sda/PS280916-percona-server-5.5.52-38.3-linux-x86_64-debug/socket.sock' port: 12933 MySQL Community Server (GPL)
InnoDB: DEBUG: update_statistics for data/#sql2ace_1_0.
InnoDB: DEBUG: update_statistics for data/#sql2ace_1_0.
InnoDB: DEBUG: update_statistics for data/#sql2ace_1_1.
InnoDB: DEBUG: update_statistics for data/#sql2ace_1_1.
InnoDB: DEBUG: update_statistics for data/#sql2ace_1_1.
InnoDB: DEBUG: update_statistics for data/#sql2ace_1_1.
InnoDB: DEBUG: update_statistics for data/#sql2ace_1_2.
InnoDB: DEBUG: update_statistics for data/#sql2ace_1_2.
InnoDB: DEBUG: update_statistics for data/#sql2ace_1_2.
InnoDB: DEBUG: update_statistics for data/#sql2ace_1_2.
160929 12:45:51 InnoDB: Assertion failure in thread 140685025306368 in file row0ins.c line 2333
InnoDB: Failing assertion: entry && row

==================

DROP DATABASE test;CREATE DATABASE test;USE test;
SET expand_fast_index_creation=1;
CREATE TEMPORARY TABLE t1(c1 INT)ENGINE=MRG_InnoDB UNION=(t1,t2) INSERT_METHOD=FIRST;
ALTER TABLE t1 ADD INDEX(c1);
INSERT INTO t1 VALUES(3),(4);
ALTER TABLE t1 KEY_BLOCK_SIZE=8;
INSERT INTO t1 VALUES(2);

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

This is a seemingly new, somewhat prominent, bug in percona-server-5.5.52-38.3-linux-x86_64-debug. May be a regression.

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

Not present in upstream.

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

Reduced testcase

SET expand_fast_index_creation=1;
CREATE TEMPORARY TABLE t1(c1 INT PRIMARY KEY, INDEX c1(c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(3);
OPTIMIZE TABLE t1;
INSERT INTO t1 VALUES(2);

tags: added: expand-fast-index-creation
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

By code review this has been here throughout whole PS 5.5 series.

The root cause is row_get_prebuilt_insert_row returning old prebuilt->ins_node, that was built using fewer indexes.

The fix would be along the lines of

commit 241387a2b6b61fb8a4f78dc4ad0aaa289400c694
Author: Marko M<C3><A4>kel<C3><A4> <email address hidden>
Date: Fri Dec 7 11:47:32 2012 +0200

    Bug#15936065 INNODB: FAILING ASSERTION: NODE->ENTRY == __NULL IN ROW0INS.CC

    The prebuilt->ins_node->entry_list should be rebuilt every time when
    indexes are added or dropped. It is not obvious that this was always
    the case.

    dict_table_t: Add def_trx_id, for identifying the transaction that
    added or dropped indexes last. If a table is evicted and again loaded
    from the data dictionary, the def_trx_id would be 0.

    row_merge_drop_indexes(): Add comments and assertions. Update
    table->def_trx_id before freeing any indexes from the data dictionary
    cache.

    row_get_prebuilt_insert_row(): Use table->def_trx_id to determine
    whether the entry_list needs to be rebuilt.

    ha_innobase::prepare_inplace_alter_table(): Do not invoke
    online_retry_drop_indexes() unless we are holding an exclusive
    meta-data lock. This would cause problem with the 'no-op' ALTER in
    the RQG test case.

    rb:1665 approved by Jimmy Yang

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-3570

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.