Bug #89126 create table panic on innobase_parse_hint_from_comment
Submitted: 7 Jan 13:42 Modified: 23 Jan 14:26
Reporter: Yan Huang (OCA) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.7.16 OS:Any
Assigned to: CPU Architecture:Any

[7 Jan 13:42] Yan Huang
MySQL panic on following backtrace: 


Cause: table is closed before read by innobase_parse_hint_from_comment, and srv_master_thread recycle innobase_table first

How to repeat:
1. create table, block its thread before innobase_parse_hint_from_comment (ha_innodb.cc)
2. let srv_master_thread trigger srv_master_evict_from_table_cache (srv0srv.cc) by gdb, preconditions:
2.1 cur_time % SRV_MASTER_DICT_LRU_INTERVAL == 0
2.2 table cache length >= table_definition_cache
3. srv_master_thread will release table->heap in dict_make_room_in_cache
4. let create-table thread go
5. MySQL panic

Suggested fix:
Patch based on 5.7 master is attached
[7 Jan 13:43] Yan Huang
patch based on MySQL 5.7 master

Attachment: mysql_panic_on_innobase_parse_hint_from_comment.diff (application/octet-stream, text), 531 bytes.

[11 Jan 9:25] Bogdan Kecman

I can reproduce this with a debugger but I'm not able to get the real-life example to reproduce this. I'll set the bug to verified and let the ibd team decide how to deal with it. As for your patch, I don't see that you signed OCA so we can't use it. If you would like to sign OCA please follow the procedure and then we can accept this as contribution.

all best

In order to submit contributions you must first sign the Oracle Contribution Agreement (OCA).
For additional information please check http://www.oracle.com/technetwork/community/oca-486395.html.
If you have any questions, please contact the MySQL community team (https://dev.mysql.com/community/).
[11 Jan 9:31] Bogdan Kecman
I'm not sure I follow what this patch does? From what I See it just removes an empty line?!
[11 Jan 13:38] Yan Huang
Hello Bogdan Kecman,
1. The patch puts `dict_table_close` line after `innobase_parse_hint_from_comment` line.
2. I will apply for OCA in days, sorry for inconvenience.
3. We found this bug in production, the following example may help:
3.1. The table cache is almost full
3.2. We created a partition-table with 12 partitions, and table cache is full
3.3. While creating table, `cur_time % SRV_MASTER_DICT_LRU_INTERVAL == 0` happens by chance (so we cannot reproduce the crash after reboot)
[19 Jan 4:08] Yan Huang
Hello Bogdan Kecman,
My OCA was sent early in this week, and waiting for reply.
[23 Jan 14:26] Yan Huang
My OCA is signed already. Thanks.
[28 Feb 6:17] Yan Huang
resent patch to Contributions tab

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: mysql_panic_on_innobase_parse_hint_from_comment.diff (application/octet-stream, text), 531 bytes.

[20 Mar 16:05] Sinisa Milivojevic

https://bugs.mysql.com/bug.php?id=90126 is a duplicate of this one.