LP #1336914: Percona Server 5.5 crashes due to a missing read view
Description
Environment
Smart Checklist
Activity
George Lorch November 21, 2019 at 10:52 PM
Incomplete and no activity for > 90 days, please request to re-open if you obtain more information of believe this is in error.
lpjirasync January 24, 2018 at 7:23 AM
**Comment from Launchpad by: Valerii Kravchuk on: 16-09-2014 11:33:00
I wonder if this can be related to http://bugs.mysql.com/bug.php?id=71768
That is, is crash repeatable if you disable that FK_order_items::orders index in the query with IGNORE INDEX(...)? Also, can it be so that you try to access row that was deleted and then inserted with the same primary key value?
If you suspect that we have http://bugs.mysql.com/bug.php?id=46175 re-appeared again or not completely fixed, had you tried to run all test cases from it with 5.5.37?
lpjirasync January 24, 2018 at 7:23 AM
**Comment from Launchpad by: Maciej Dobrzanski on: 25-08-2014 18:13:23
After further research, this problem looks peculiarly similar to http://bugs.mysql.com/bug.php?id=46175 (which affected 5.1 and was fixed). I'm providing some additional information below.
(gdb) bt
#0 0x00007f87915778ac in pthread_kill () from /lib64/libpthread.so.0
#1 0x000000000069ea6e in handle_fatal_signal (sig=6) at /usr/src/debug/percona-server-5.5.37-35.1/sql/signal_handler.cc:250
#2 <signal handler called>
#3 0x00007f878fdef925 in raise () from /lib64/libc.so.6
#4 0x00007f878fdf1105 in abort () from /lib64/libc.so.6
#5 0x0000000000817459 in row_search_for_mysql (buf=0x7f80980db7c0 "x\n\275\363\001\347
", <incomplete sequence \351>, mode=<value optimized out>, prebuilt=0x7f8098084ea8, match_mode=<value optimized out>, direction=1) at /usr/src/debug/percona-server-5.5.37-35.1/storage/innobase/row/row0sel.c:3860
#6 0x00000000007e9e14 in ha_innobase::general_fetch (this=0x7f8098054790, buf=0x7f80980db7c0 "x\n\275\363\001\347
", <incomplete sequence \351>, direction=1, match_mode=1) at /usr/src/debug/percona-server-5.5.37-35.1/storage/innobase/handler/ha_innodb.cc:7168
#7 0x00000000005bb321 in join_read_next_same (info=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:12568
#8 0x00000000005bd7e9 in sub_select (join=0x7f7f0c0b41d8, join_tab=0x7f7f0c0c2b78, end_of_records=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:11860
#9 0x00000000005b52f1 in evaluate_join_record (join=0x7f7f0c0b41d8, join_tab=0x7f7f0c0c2910, error=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:12003
#10 0x00000000005bd7f6 in sub_select (join=0x7f7f0c0b41d8, join_tab=0x7f7f0c0c2910, end_of_records=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:11856
#11 0x00000000005b52f1 in evaluate_join_record (join=0x7f7f0c0b41d8, join_tab=0x7f7f0c0c26a8, error=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:12003
#12 0x00000000005bd7f6 in sub_select (join=0x7f7f0c0b41d8, join_tab=0x7f7f0c0c26a8, end_of_records=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:11856
#13 0x00000000005b52f1 in evaluate_join_record (join=0x7f7f0c0b41d8, join_tab=0x7f7f0c0c2440, error=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:12003
#14 0x00000000005bd7f6 in sub_select (join=0x7f7f0c0b41d8, join_tab=0x7f7f0c0c2440, end_of_records=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:11856
#15 0x00000000005b52f1 in evaluate_join_record (join=0x7f7f0c0b41d8, join_tab=0x7f7f0c0c21d8, error=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:12003
#16 0x00000000005bd7f6 in sub_select (join=0x7f7f0c0b41d8, join_tab=0x7f7f0c0c21d8, end_of_records=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:11856
#17 0x00000000005b52f1 in evaluate_join_record (join=0x7f7f0c0b41d8, join_tab=0x7f7f0c0c1f70, error=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:12003
#18 0x00000000005bd7f6 in sub_select (join=0x7f7f0c0b41d8, join_tab=0x7f7f0c0c1f70, end_of_records=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:11856
#19 0x00000000005be1b7 in do_select (join=0x7f7f0c0b41d8, fields=0x7f7f0c0b5850, table=0x0, procedure=0x0) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:11621
#20 0x00000000005d5933 in JOIN::exec (this=0x7f7f0c0b41d8) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:2428
#21 0x00000000005d70ac in mysql_select (thd=0x2b43ce00, rref_pointer_array=<value optimized out>, tables=<value optimized out>, wild_num=1, fields=<value optimized out>, conds=<value optimized out>, og_num=1, order=0x0, group=0x7f7f0c00acd8, having=0x0, proc_param=0x0, select_options=2147748096, result=0x7f7f0c0688a0, unit=0x2b43eb10, select_lex=0x2b43f130) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:2647
#22 0x00000000005d7b5d in handle_select (thd=0x2b43ce00, lex=0x2b43ea50, result=0x7f7f0c0688a0, setup_tables_done_option=0) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_select.cc:315
#23 0x0000000000590f1a in execute_sqlcom_select (thd=0x2b43ce00, all_tables=0x7f7f0c002380) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_parse.cc:4850
#24 0x000000000059670a in mysql_execute_command (thd=0x2b43ce00) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_parse.cc:2343
#25 0x000000000059975b in mysql_parse (thd=0x2b43ce00, rawbuf=<value optimized out>, length=725871184, parser_state=0x7f8123d9af70) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_parse.cc:5922
#26 0x000000000059bdde in dispatch_command (command=COM_QUERY, thd=0x2b43ce00, packet=<value optimized out>, packet_length=670) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_parse.cc:1079
#27 0x000000000063b6af in do_handle_one_connection (thd_arg=<value optimized out>) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_connect.cc:1409
#28 0x000000000063b791 in handle_one_connection (arg=0x2b76c510) at /usr/src/debug/percona-server-5.5.37-35.1/sql/sql_connect.cc:1324
#29 0x00007f87915729d1 in start_thread () from /lib64/libpthread.so.0
#30 0x00007f878fea5b6d in clone () from /lib64/libc.so.6
#31 0x0000000000000000 in ?? ()
(gdb) frame 5
#5 0x0000000000817459 in row_search_for_mysql (buf=0x7f80980db7c0 "x\n\275\363\001\347
", <incomplete sequence \351>, mode=<value optimized out>, prebuilt=0x7f8098084ea8, match_mode=<value optimized out>, direction=1) at /usr/src/debug/percona-server-5.5.37-35.1/storage/innobase/row/row0sel.c:3860
3860 ut_error;
(gdb) print *prebuilt
$90 = {
magic_n = 78540783,
table = 0x7f80ec0564d8,
index = 0x7f80ec057a28,
trx = 0x7f7f0c007ce8,
sql_stat_start = 0,
mysql_has_locked = 1,
clust_index_was_generated = 0,
index_usable = 1,
read_just_key = 0,
used_in_HANDLER = 0,
template_type = 1,
n_template = 4,
null_bitmap_len = 1,
need_to_access_clustered = 1,
templ_contains_blob = 0,
mysql_template = 0x7f8098160348,
heap = 0x7f8098084e30,
ins_node = 0x7f80980858c0,
ins_upd_rec_buff = 0x7f8098085978 "(\001\375\247", <incomplete sequence \350>,
default_rec = 0x7f80dc02e250 <incomplete sequence \370>,
hint_need_to_fetch_extra_cols = 0,
upd_node = 0x0,
ins_graph = 0x7f8098085c10,
upd_graph = 0x0,
pcur = {
btr_cur = {
index = 0x7f80ec057a28,
page_cur = {
rec = 0x7f874baa93bc "",
block = 0x7f8183398250
},
purge_node = 0x0,
left_block = 0x0,
thr = 0x0,
flag = BTR_CUR_BINARY,
tree_height = 3,
up_match = 1,
up_bytes = 0,
low_match = 0,
low_bytes = 3,
n_fields = 1,
n_bytes = 0,
fold = 3380495230209520925,
path_arr = 0x0
},
latch_mode = 1,
old_stored = 908467085,
old_rec = 0x7f80980dbc1d "",
old_n_fields = 2,
rel_pos = 1,
block_when_stored = 0x7f8183398250,
modify_clock = 0,
pos_state = BTR_PCUR_IS_POSITIONED,
search_mode = 2,
trx_if_known = 0x7f7f0c007ce8,
old_rec_buf = 0x7f80980dbc18 "\004\v", <incomplete sequence \350>,
buf_size = 16
},
clust_pcur = {
btr_cur = {
index = 0x7f80ec0570e8,
page_cur = {
rec = 0x7f876ab053ce "\001\363\275\n",
block = 0x7f81840ae920
},
purge_node = 0x0,
left_block = 0x0,
thr = 0x0,
flag = BTR_CUR_HASH,
tree_height = 3,
up_match = 0,
up_bytes = 3,
low_match = 1,
low_bytes = 0,
n_fields = 1,
n_bytes = 0,
fold = 3380494932167799515,
path_arr = 0x0
},
latch_mode = 1,
old_stored = 122766467,
old_rec = 0x0,
old_n_fields = 0,
rel_pos = 0,
block_when_stored = 0x0,
modify_clock = 0,
pos_state = BTR_PCUR_IS_POSITIONED,
search_mode = 4,
trx_if_known = 0x7f7f0c007ce8,
old_rec_buf = 0x0,
buf_size = 0
},
sel_graph = 0x7f8098085740,
search_tuple = 0x7f80980851c8,
row_id = "\000\000\000\000\000",
clust_ref = 0x7f8098085618,
select_lock_type = 5,
stored_select_lock_type = 5,
row_read_type = 0,
new_rec_locks = 0,
mysql_prefix_len = 17,
mysql_row_len = 85,
n_rows_fetched = 8,
fetch_direction = 1,
fetch_cache = {0x7f7e8001264c "x\003\275\363\001\347
", <incomplete sequence \351>, 0x7f7e8001272c "", 0x7f7e8001246c "x\005\275\363\001\347
", <incomplete sequence \351>, 0x7f7e8001254c "x\006\275\363\001\347
", <incomplete sequence \351>, 0x7f7e8001710c "", 0x7f7e800171ec "", 0x7f7e800172cc "", 0x7f7e800173ac "x\n\275\363\001\347
", <incomplete sequence \351>},
keep_other_fields_on_keyread = 0,
fetch_cache_first = 0,
n_fetch_cached = 0,
blob_heap = 0x0,
old_vers_heap = 0x0,
autoinc_last_value = 0,
autoinc_increment = 1,
autoinc_offset = 0,
autoinc_error = 10,
magic_n2 = 78540783
}
(gdb) print *prebuilt->trx
$91 = {
magic_n = 91118598,
op_info = 0xa46a42 "fetching rows",
state = 1,
is_registered = 1,
owns_prepare_mutex = 0,
called_commit_ordered = 0,
is_in_trx_serial_list = 0,
isolation_level = 2,
check_foreigns = 1,
check_unique_secondary = 1,
support_xa = 0,
fake_changes = 0,
flush_log_later = 0,
must_flush_log_later = 0,
duplicates = 0,
has_search_latch = 0,
deadlock_mark = 0,
dict_operation = TRX_DICT_OP_NONE,
declared_to_be_inside_innodb = 0,
dict_operation_lock_mode = 0,
is_purge = 0,
is_recovered = 0,
que_state = 0,
handling_signals = 0,
start_time = 1404420582,
id = 72589300363,
xid = {
formatID = -1,
gtrid_length = 0,
bqual_length = 0,
data = '\000' <repeats 127 times>
},
no = 18446744073709551615,
commit_lsn = 0,
table_id = 0,
mysql_thd = 0x2b43ce00,
mysql_log_file_name = 0x0,
mysql_log_offset = 0,
mysql_master_log_file_name = 0x9de4ff "",
mysql_master_log_pos = 0,
mysql_relay_log_file_name = 0x9de4ff "",
mysql_relay_log_pos = 0,
idle_start = 0,
last_stmt_start = 0,
n_mysql_tables_in_use = 16,
mysql_n_tables_locked = 16,
search_latch_timeout = 10000,
n_tickets_to_enter_innodb = 0,
trx_list = {
prev = 0x7f7e6401bbd8,
next = 0x0
},
mysql_trx_list = {
prev = 0x7f7e6401bbd8,
next = 0x7f7e88006428
},
trx_serial_list = {
prev = 0x0,
next = 0x0
},
error_state = 10,
error_info = 0x6f6f6c6574756168,
error_key_num = 0,
sess = 0x2b2c4358,
graph = 0x0,
n_active_thrs = 1,
graph_before_signal_handling = 0x0,
sig = {
type = 0,
sender = 0,
receiver = 0x0,
savept = {
least_undo_no = 0
},
signals = {
prev = 0x0,
next = 0x0
},
reply_signals = {
prev = 0x0,
next = 0x0
}
},
signals = {
count = 0,
start = 0x0,
end = 0x0
},
reply_signals = {
count = 0,
start = 0x0,
end = 0x0
},
wait_lock = 0x0,
was_chosen_as_deadlock_victim = 0,
wait_started = 140183638933528,
wait_thrs = {
count = 0,
start = 0x0,
end = 0x0
},
lock_heap = 0x7f7f0c008280,
trx_locks = {
count = 0,
start = 0x0,
end = 0x0
},
global_read_view = 0x0,
read_view = 0x0,
prebuilt_view = 0x7f7f0c010ec0,
trx_savepoints = {
count = 0,
start = 0x0,
end = 0x0
},
undo_mutex = {
event = 0x7f7f0c0081f0,
lock_word = 0 '\000',
waiters = 0,
list = {
prev = 0x7f7e6401bef8,
next = 0x7f7e88006748
},
count_os_wait = 0,
cmutex_name = 0xa4cddc "&trx->undo_mutex",
pfs_psi = 0x0
},
undo_no = 0,
last_sql_stat_start = {
least_undo_no = 0
},
rseg = 0x2b2b2e48,
insert_undo = 0x0,
update_undo = 0x0,
roll_limit = 0,
pages_undone = 0,
undo_no_arr = 0x7f7f0c0e5288,
n_autoinc_rows = 0,
autoinc_locks = 0x7f7f0c008478,
detailed_error = "\000b\377\000\000\000\000\000\002\000\000\000\003\000\000\000\000_li\377\377\377\377(\201\000\f\177\177\000\000\070\201\000\f\177\177\000\000@\201\000\f\177\177\000\000P\341\231+\000\000\000\000(\201\000\f\177\177\000\000\070\201\000\f\177\177\000\000@\201\000\f\177\177\000\000\000\000\000\000\377\377\377\377p\024\000\f\177\177", '\000' <repeats 35 times>, "\177\000\f", '\000' <repeats 12 times>, "production\000\000m\000\000\000\001\000\000\000inc_optin\000\000\000\000\000\000\000h\202\000\f\177\177\000\000@\200\000\f\177\177\000\000PP\363", '\000' <repeats 37 times>"\300, \315\373\000\000\000\000\000`\202\000\f\177\177\000",
io_reads = 0,
io_read = 0,
io_reads_wait_timer = 0,
lock_que_wait_ustarted = 72057594038001408,
lock_que_wait_timer = 0,
innodb_que_wait_timer = 0,
distinct_page_access = 0,
distinct_page_access_hash = 0x0,
take_stats = 0
}
lpjirasync January 24, 2018 at 7:23 AM
**Comment from Launchpad by: Maciej Dobrzanski on: 12-08-2014 11:57:16
Attaching EXPLAIN output with table structures
lpjirasync January 24, 2018 at 7:23 AM
**Comment from Launchpad by: Muhammad Irfan on: 08-07-2014 12:26:53
Can you please provide EXPLAIN output of the query along with table definitions (SHOW CREATE TABLE) of all involved tables in query to investigate it further.
**Reported in Launchpad by Maciej Dobrzanski last update 24-03-2016 16:42:44
From time to time InnoDB crashes on a missing read view:
InnoDB: Error: MySQL is trying to perform a consistent read
InnoDB: but the read view is not assigned!
TRANSACTION 10D73B17C1, ACTIVE 0 sec fetching rows
mysql tables in use 16, locked 14
MySQL thread id 56365847, OS thread handle 0x7fc4e7bdb700, query id 721061456 10.0.0.8 liquid8_wm
SELECT `ri`.*, COUNT(DISTINCT ri.item_id) AS `quantity`, `ev`.`title`, `sk`.`color`, `sk`.`size`, `sk`.`location`, `st`.`na
me`, `st`.`style_num`, `img`.`image_id`, get_order_items_status(oi.item_id) AS `order_status` FROM `return_items` AS `ri`
INNER JOIN `events` AS `ev` ON ev.event_id = ri.event_id
INNER JOIN `skus` AS `sk` ON sk.sku = ri.sku
INNER JOIN `styles` AS `st` ON st.style_id = sk.style_id
INNER JOIN `images` AS `img` ON img.style_id = sk.style_id AND img.color = REPLACE(sk.color," ","_")
INNER JOIN `order_items` AS `oi` ON oi.order_id = ri.order_id AND oi.event_id = ri.event_i
InnoDB: Assertion failure in thread 140483678287616 in file row0sel.c line 3860
The problem appears at random times, but the query in the crash report is always the same. Running the query by hand has never triggered crash, so the query alone does not seem to be a problem. The problem does not exist in any 5.1 instances handling the same traffic (load balanced).
Here's the resolved stack dump:
0x7c9c65 my_print_stacktrace + 53
0x69eac4 handle_fatal_signal + 1204
0x817459 row_search_for_mysql + 1497
0x7e9e14 _ZN11ha_innobase13general_fetchEPhjj + 164
0x5bb321 _ZL19join_read_next_sameP11READ_RECORD + 49
0x5bd7e9 _Z10sub_selectP4JOINP13st_join_tableb + 121
0x5b52f1 _ZL20evaluate_join_recordP4JOINP13st_join_tablei + 289
0x5bd7f6 _Z10sub_selectP4JOINP13st_join_tableb + 134
0x5b52f1 _ZL20evaluate_join_recordP4JOINP13st_join_tablei + 289
0x5bd7f6 _Z10sub_selectP4JOINP13st_join_tableb + 134
0x5b52f1 _ZL20evaluate_join_recordP4JOINP13st_join_tablei + 289
0x5bd7f6 _Z10sub_selectP4JOINP13st_join_tableb + 134
0x5b52f1 _ZL20evaluate_join_recordP4JOINP13st_join_tablei + 289
0x5bd7f6 _Z10sub_selectP4JOINP13st_join_tableb + 134
0x5b52f1 _ZL20evaluate_join_recordP4JOINP13st_join_tablei + 289
0x5bd7f6 _Z10sub_selectP4JOINP13st_join_tableb + 134
0x5be1b7 _ZL9do_selectP4JOINP4ListI4ItemEP5TABLEP9Procedure + 295
0x5d5933 _ZN4JOIN4execEv + 3139
0x5d70ac _Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select + 300
0x5d7b5d _Z13handle_selectP3THDP3LEXP13select_resultm + 461
0x590f1a _ZL21execute_sqlcom_selectP3THDP10TABLE_LIST + 218
0x59670a _Z21mysql_execute_commandP3THD + 7978
0x59975b _Z11mysql_parseP3THDPcjP12Parser_state + 827
0x59bdde _Z16dispatch_command19enum_server_commandP3THDPcj + 7598
0x63b6af _Z24do_handle_one_connectionP3THD + 319
0x63b791 handle_one_connection + 81
I may be able to get more details from a core dump when this instance crashes again.
This happens in Percona Server 5.5.37-35.1.