diff options
author | Andrei Elkin <andrei.elkin@oracle.com> | 2011-10-27 17:14:41 +0300 |
---|---|---|
committer | Andrei Elkin <andrei.elkin@oracle.com> | 2011-10-27 17:14:41 +0300 |
commit | a7127418a78fea97d93d8adb9d3c3c124b8e3720 (patch) | |
tree | e25dca9ae13ab5c59597fca8c33bbf60645adacd /sql/log.h | |
parent | 27341322e424069432dc1811484f90417fd8e9ed (diff) | |
download | mariadb-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/log.h')
-rw-r--r-- | sql/log.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/log.h b/sql/log.h index 0f0f81dd402..481bd545960 100644 --- a/sql/log.h +++ b/sql/log.h @@ -455,7 +455,9 @@ public: void make_log_name(char* buf, const char* log_ident); bool is_active(const char* log_file_name); int update_log_index(LOG_INFO* linfo, bool need_update_threads); - int rotate_and_purge(uint flags); + int rotate(bool force_rotate, bool* check_purge); + void purge(); + int rotate_and_purge(bool force_rotate); /** Flush binlog cache and synchronize to disk. |