| Bug #87477 | Semaphore wait crash due to long held lock during online index creation | ||
|---|---|---|---|
| Submitted: | 18 Aug 2017 14:27 | Modified: | 3 Dec 2018 20:50 |
| Reporter: | Tate McDaniel | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
| Version: | 5.7.12 | OS: | Debian (8.5) |
| Assigned to: | CPU Architecture: | Any | |
[18 Aug 2017 14:27]
Tate McDaniel
[20 Nov 2018 8:43]
MySQL Verification Team
DML stopped here:
Thread 134 (Thread 0x7f9a340ad700 (LWP 160092)):
#0 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 in wait at ./storage/innobase/os/os0event.cc:165
#2 in os_event::wait_low at ./storage/innobase/os/os0event.cc:335
#3 in sync_array_wait_event at ./storage/innobase/sync/sync0arr.cc:475
#4 in rw_lock_s_lock_spin at ./storage/innobase/sync/sync0rw.cc:425
#5 in rw_lock_s_lock_func at ./storage/innobase/include/sync0rw.ic:433
#6 in pfs_rw_lock_s_lock_func at ./storage/innobase/include/sync0rw.ic:796
#7 in s_lock at ./storage/innobase/include/mtr0mtr.ic:244
#8 in row_ins_sec_index_entry_low at ./storage/innobase/row/row0ins.cc:2914
#9 in row_ins_sec_index_entry at ./storage/innobase/row/row0ins.cc:3385
#10 in row_ins_index_entry at ./storage/innobase/row/row0ins.cc:3431
#11 in row_ins_index_entry_step at ./storage/innobase/row/row0ins.cc:3579
#12 in row_ins at ./storage/innobase/row/row0ins.cc:3721
#13 in row_ins_step at ./storage/innobase/row/row0ins.cc:3906
#14 in row_insert_for_mysql_using_ins_graph at ./storage/innobase/row/row0mysql.cc:1733
#15 in ha_innobase::write_row at ./storage/innobase/handler/ha_innodb.cc:7494
#16 in handler::ha_write_row at ./sql/handler.cc:7923
#17 in write_record at ./sql/sql_insert.cc:1871
#18 in Sql_cmd_insert::mysql_insert at ./sql/sql_insert.cc:769
#19 in Sql_cmd_insert::execute at ./sql/sql_insert.cc:3103
#20 in mysql_execute_command at ./sql/sql_parse.cc:3606
#21 in mysql_parse at ./sql/sql_parse.cc:5611
#22 in Query_log_event::do_apply_event at ./sql/log_event.cc:4595
#23 in Log_event::apply_event at ./sql/log_event.cc:3242
#24 in apply_event_and_update_pos at ./sql/rpl_slave.cc:4702
#25 in exec_relay_log_event at ./sql/rpl_slave.cc:5212
#26 in handle_slave_sql at ./sql/rpl_slave.cc:7320
----
/* Ensure that we acquire index->lock when inserting into an
index with index->online_status == ONLINE_INDEX_COMPLETE, but
could still be subject to rollback_inplace_alter_table().
This prevents a concurrent change of index->online_status.
The memory object cannot be freed as long as we have an open
reference to the table, or index->table->n_ref_count > 0. */
const bool check = !index->is_committed();
if (check) {
DEBUG_SYNC_C("row_ins_sec_index_enter");
if (mode == BTR_MODIFY_LEAF) {
search_mode |= BTR_ALREADY_S_LATCHED;
mtr_s_lock(dict_index_get_lock(index), &mtr); <------------------------------
} else {
mtr_sx_lock(dict_index_get_lock(index), &mtr);
}
if (row_log_online_op_try(
index, entry, thr_get_trx(thr)->id)) {
goto func_exit;
}
}
[1 Dec 2018 7:23]
MySQL Verification Team
See: https://bugs.mysql.com/bug.php?id=82940
[3 Dec 2018 20:50]
MySQL Verification Team
I' setting this one as duplicate of #82940
