Bug #99315 | MySQL hangs during purge binary logs operation | ||
---|---|---|---|
Submitted: | 21 Apr 2020 4:28 | Modified: | 6 May 2020 13:50 |
Reporter: | sampath choudary kamineni | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Logging | Severity: | S2 (Serious) |
Version: | 5.7.29 | OS: | CentOS (2.6.32-754.28.1.el6.x86_64) |
Assigned to: | CPU Architecture: | x86 |
[21 Apr 2020 4:28]
sampath choudary kamineni
[21 Apr 2020 4:31]
sampath choudary kamineni
trace using pt-pmp
Attachment: st.txt (text/plain), 9.87 KiB.
[21 Apr 2020 4:32]
sampath choudary kamineni
full pstack
Attachment: pstack_3605_11 (application/octet-stream, text), 346.69 KiB.
[21 Apr 2020 16:25]
MySQL Verification Team
Thank you for the bug report. Duplicate of https://bugs.mysql.com/bug.php?id=83526, https://bugs.mysql.com/bug.php?id=71901,https://bugs.mysql.com/bug.php?id=44150.
[21 Apr 2020 20:40]
sampath choudary kamineni
Hi Miguel, Thanks for checking on this. I feel like this is not a duplicate of above mentioned bug as in my case, mysql freezes even when I try to purge 1 binary log file manually Purge of one binary log file of size 300MB takes around 13 minutes and all connects to mysql freezes for that period. I have attached the pt-pmp trace for purging one log file here . Could anyone please help me in figuring out this part from my pt-pmp trace that I attached , I am confused on the check for gtid state as I dont have it enabled. ``` 1 read(libpthread.so.0),my_read,_my_b_read,Log_event::read_log_event,read_gtids_from_binlog,MYSQL_BIN_LOG::init_gtid_sets,MYSQL_BIN_LOG::purge_logs,purge_master_logs,mysql_execute_command,mysql_parse,dispatch_command,do_command,handle_connection,pfs_spawn_thread,start_thread(libpthread.so.0),clone(libc.so.6) 1 pthread_rwlock_wrlock(libpthread.so.0),Sys_var_gtid_purged::global_value_ptr,sys_var::value_ptr,Item_func_get_system_var::val_str,get_system_var,PTI_variable_aux_3d::itemize,PTI_expr_with_alias::itemize,PT_select_item_list::contextualize,PT_select_options_and_item_list::contextualize,PT_select_part2::contextualize,PT_select_init2::contextualize,PT_select::contextualize,MYSQLparse,parse_sql,mysql_parse,dispatch_command,do_command,handle_connection,pfs_spawn_thread,start_thread(libpthread.so.0),clone(libc.so.6) 1 pthread_rwlock_wrlock(libpthread.so.0),show_master_status,mysql_execute_command,mysql_parse,dispatch_command,do_command,handle_connection,pfs_spawn_thread,start_thread(libpthread.so.0),clone(libc.so.6) 1 pthread_rwlock_rdlock(libpthread.so.0),Gtid_state::update_gtids_impl,MYSQL_BIN_LOG::finish_commit,MYSQL_BIN_LOG::ordered_commit,MYSQL_BIN_LOG::commit,ha_commit_trans,trans_commit,Xid_log_event::do_commit,Xid_apply_log_event::do_apply_event,Log_event::apply_event,apply_event_and_update_pos,exec_relay_log_event,handle_slave_sql,pfs_spawn_thread,start_thread(libpthread.so.0),clone(libc.so.6) ``` Thanks in advance . attachment to follow.
[21 Apr 2020 20:42]
sampath choudary kamineni
Pt-pmp trace for purging one logfile.
Attachment: pt-pmp-purge-1-log.txt (text/plain), 11.97 KiB.
[22 Apr 2020 16:19]
MySQL Verification Team
Hi, I am not sure this is the duplicate of the mentioned bugs. Dev team is suggesting that this is likely the result of using binlog_gtid_simple_recovery=OFF and gtid_mode=OFF. On 5.7.29, it is safe to switch to binlog_gtid_simple_recovery=ON, if the oldest binlog file uses 5.7.5 or newer (you can check with binlog). That should solve the problem. I'm verifying the behavior. Please try the workaround. all best Bogdan
[23 Apr 2020 18:57]
sampath choudary kamineni
Hi Bogdan , Thank you for looking into this. I shall update binlog_gtid_simple_recovery --> TRUE and post results here. Best, Sampath Kamineni
[28 Apr 2020 21:01]
sampath choudary kamineni
Thank you Bogdan , updating binlog_gtid_simple_recovery to TRUE fixed the issue . I Just wanted to confirm , if it is expected to have this check inspite of having gtid turned off? Thanks again for the help. Everything works fine now.
[29 Apr 2020 15:12]
MySQL Verification Team
Hi, Thanks for confirming the workaround works. I still think this is a bug, that is just a workaround so that system will work. Now how/when/if this will be fixed I can't say but since there is a workaround I don't think the priority will be very high. in good health Bogdan
[6 May 2020 13:50]
MySQL Verification Team
Hi, Final decision is that this is not a bug. https://dev.mysql.com/doc/refman/5.7/en/replication-options-gtids.html#sysvar_binlog_gtid_... - binlog_gtid_simple_recovery=OFF is for compatibility with 5.7.5 and older. It is documented that this is slow when there are many binary logs and gtid_mode=OFF. (It is impossible to fix the slowness, since 5.7.5 and older don't have necessary information in the binary log to make the procedure fast.) - binlog_gtid_simple_recovery=ON is the default and does not have this problem. all best Bogdan