SHOW STATUS in parallel to online buffer pool resizing may crash
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Invalid
|
Undecided
|
Unassigned | |||
5.6 |
Invalid
|
Undecided
|
Unassigned | |||
5.7 |
Fix Released
|
High
|
Laurynas Biveinis |
Bug Description
2016-04-
02:11:55 UTC - mysqld got signal 11 ;
...
Thread 1 (Thread 0x8a05ab40 (LWP 3478)):
#0 0xb77b4420 in __kernel_vsyscall ()
#1 0xb7531ff3 in __pthread_kill (threadid=
#2 0x08b33c37 in my_write_core (sig=11) at /mnt/workspace/
#3 0x083a43b1 in handle_fatal_signal (sig=11) at /mnt/workspace/
#4 <signal handler called>
#5 srv_export_
#6 0x08b5bc01 in innodb_
#7 show_innodb_vars (thd=0xa16a228, var=0x8a057598, buff=0x8a057608 "\006") at /mnt/workspace/
#8 0x0893f936 in show_status_array (thd=thd@
#9 0x0894788c in fill_status (thd=0xa16a228, tables=0x9f3ef40, cond=0x9f3f4f8) at /mnt/workspace/
#10 0x0893192f in do_fill_table (thd=thd@
#11 0x0894680c in get_schema_
#12 0x089272e8 in JOIN::prepare_
#13 0x088aff69 in JOIN::exec (this=0xa1b4a80) at /mnt/workspace/
#14 0x08927c55 in handle_query (thd=thd@
#15 0x08356a2d in execute_
#16 0x088e7a16 in mysql_execute_
#17 0x088e9ba0 in mysql_parse (thd=thd@
#18 0x088e9c82 in wsrep_mysql_parse (thd=thd@
#19 0x088eb53b in dispatch_command (thd=thd@
#20 0x088ed4fd in do_command (thd=thd@
#21 0x089bf338 in handle_connection (arg=arg@
#22 0x08ef9dd3 in pfs_spawn_thread (arg=0x9ee0bf8) at /mnt/workspace/
#23 0xb752cf70 in start_thread (arg=0x8a05ab40) at pthread_
#24 0xb7317bee in clone () at ../sysdeps/
The crashing line is
mem_adaptive_hash += mem_heap_
in srv_export_
ut_ad(
for (i = 0; i < btr_ahi_parts; i++) {
hash_table_t* ht = btr_search_
ut_ad(ht);
ut_ad(ht->heap);
/* Multiple mutexes/heaps are currently never used for adaptive
hash index tables. */
ut_ad(
ut_ad(
mem_adaptive_hash += mem_heap_
mem_adaptive_hash += ht->n_cells * sizeof(
}
So we read AHI hash tables without any locking. But online buffer pool resize may make those pointers dangling, in parallel:
void
btr_search_
{
/* Step-1: Lock all search latches in exclusive mode. */
btr_search_
...
/* Step-2: Recreate hash tables with new size. */
for (ulint i = 0; i < btr_ahi_parts; ++i) {
mem_heap_
hash_
btr_search_
...
}
Similar reasoning applies in the next srv_export_
tags: | added: xtradb |
summary: |
- SHOW VARIABLES in parallel to online buffer pool resizing may crash + SHOW STATUS in parallel to online buffer pool resizing may crash |
https:/ /github. com/percona/ percona- server/ pull/476