summaryrefslogtreecommitdiff
path: root/sql/sql_reload.cc
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@oracle.com>2011-10-27 17:14:41 +0300
committerAndrei Elkin <andrei.elkin@oracle.com>2011-10-27 17:14:41 +0300
commita7127418a78fea97d93d8adb9d3c3c124b8e3720 (patch)
treee25dca9ae13ab5c59597fca8c33bbf60645adacd /sql/sql_reload.cc
parent27341322e424069432dc1811484f90417fd8e9ed (diff)
downloadmariadb-git-a7127418a78fea97d93d8adb9d3c3c124b8e3720.tar.gz
Bug#11763573 - 56299: MUTEX DEADLOCK WITH COM_BINLOG_DUMP, BINLOG PURGE, AND PROCESSLIST/KILL
The bug case is similar to one fixed earlier bug_49536. Deadlock involving LOCK_log appears to be possible because the purge running thread is holding LOCK_log whereas there is no sense of doing that and which fact was exploited by the earlier bug fixes. Fixed with small reengineering of rotate_and_purge(), adding two new methods and setting up a policy to execute those instead of the former rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED). The policy for using rotate(), purge() is that if the caller acquires LOCK_log itself, it should call rotate(), release the mutex and run purge(). Side effect of this patch is refining error message of bug@11747416 to print the whole path.
Diffstat (limited to 'sql/sql_reload.cc')
-rw-r--r--sql/sql_reload.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index b567e3a1f85..089077bb89c 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -141,7 +141,7 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
tmp_write_to_binlog= 0;
if (mysql_bin_log.is_open())
{
- if (mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE))
+ if (mysql_bin_log.rotate_and_purge(true))
*write_to_binlog= -1;
}
}