summaryrefslogtreecommitdiff
path: root/sql/rpl_rli.cc
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2010-02-03 16:56:17 +0000
committerLuis Soares <luis.soares@sun.com>2010-02-03 16:56:17 +0000
commitd0ffa8e51b104839a9e397aacda8ca1f110e3fad (patch)
tree0830be99ef4b6b308d020c571711d5f5a06e04f9 /sql/rpl_rli.cc
parentda88c90aa2e81a6e7e36e775b9857bc90be69e98 (diff)
downloadmariadb-git-d0ffa8e51b104839a9e397aacda8ca1f110e3fad.tar.gz
BUG#50364: FLUSH LOGS crashes the server (rpl.rpl_heartbeat_basic
fails in PB sporadically) The IO thread can concurrently access the relay log IO_CACHE while another thread is performing an FLUSH LOGS procedure. FLUSH LOGS closes and reopens the relay log and while doing so it (re)initializes its IO_CACHE. During this procedure the IO_CACHE mutex is also reinitialized, which can cause problems if some other thread (namely the IO THREAD) is concurrently accessing it at the time . This patch fixes the problem by extending the interface of the flush_master_info function to also include a second paramater, "need_relay_log_lock", stating whether the thread should grab the relay log lock or not before actually flushing the relay log. Also, IO thread now calls flush_master_info with this flag set when it flushes master info with in the event read_event loop. Finally, we also increase loop time in rpl_heartbeat_basic test case, so that the number of calls to flush logs doubles, stressing this part of the code a little more.
Diffstat (limited to 'sql/rpl_rli.cc')
-rw-r--r--sql/rpl_rli.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 4bbafa0253a..fa979fe9a21 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -121,7 +121,7 @@ int init_relay_log_info(Relay_log_info* rli,
/*
The relay log will now be opened, as a SEQ_READ_APPEND IO_CACHE.
Note that the I/O thread flushes it to disk after writing every
- event, in flush_master_info(mi, 1).
+ event, in flush_master_info(mi, 1, ?).
*/
/*