Bug #70237 | the mysqladmin shutdown hangs | ||
---|---|---|---|
Submitted: | 4 Sep 2013 5:43 | Modified: | 10 Dec 2018 13:23 |
Reporter: | zhai weixiang (OCA) | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S3 (Non-critical) |
Version: | 5.5,5.6 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[4 Sep 2013 5:43]
zhai weixiang
[5 Sep 2013 1:47]
zhai weixiang
a simple patch to workaround the hang.(based on 5.6.13) Index: sql/rpl_master.cc =================================================================== --- sql/rpl_master.cc (revision 4367) +++ sql/rpl_master.cc (working copy) @@ -1498,6 +1498,11 @@ PSI_stage_info old_stage; signal_cnt= mysql_bin_log.signal_cnt; + if (thd->killed) { + mysql_mutex_unlock(log_lock); + goto end; + } + do { if (heartbeat_period != 0)
[11 Sep 2013 1:51]
zhai weixiang
can anyone confirm this bug ? If you need more information , please let me know.
[27 Sep 2013 3:32]
liu hickey
kill_server_thread() is waiting thread_count to be decreased to 0 in close_connections(), while mysql_binlog_send() is waiting new events to be arrived in binlog, that caused the deadlock. When kill_server_thread() set kill flag and broadcasts before dump request thread endless waiting in mysql_binlog_send(), is the race condition for deadlock. The later patch provided by yinfeng, just catch the broadcast-before-wait case: @@ -896,7 +896,7 @@ int ret; ulong signal_cnt; DBUG_PRINT("wait",("waiting for data in binary log")); - if (thd->server_id==0) // for mysqlbinlog (mysqlbinlog.server_id==0) + if (thd->server_id==0 || thd->killed) // for mysqlbinlog (mysqlbinlog.server_id==0) { mysql_mutex_unlock(log_lock); goto end;
[27 Dec 2013 5:50]
zhai weixiang
my fix seems incorrect. should check thd->killed after ENTER_COND
[7 Nov 2018 14:03]
MySQL Verification Team
Hi, Thank you for your report. However, I have inspected a code and this problem definitely seems to me to be fixed in 5.7 and 8.0. Do note that there was major reorganisation of this part of code in 5.7 and 8.0, so this time look for the source in rpl_slave.cc. Let us know if you think otherwise.
[8 Dec 2018 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".