summaryrefslogtreecommitdiff
path: root/sql/rpl_mi.h
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
commit55aab082a957e3f20e94f791dbe44750b4b465c8 (patch)
tree0830be99ef4b6b308d020c571711d5f5a06e04f9 /sql/rpl_mi.h
parent54fc7997e217c7556f06693f1d04caf5ce8ca36b (diff)
downloadmariadb-git-55aab082a957e3f20e94f791dbe44750b4b465c8.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. mysql-test/suite/rpl/t/rpl_heartbeat_basic.test: Doubled the number of iterations on the FLUSH LOGS loop by doubling the time available to perform all iterations. sql/repl_failsafe.cc: Updating flush_master_info call so that it uses two parameters instead of one. sql/rpl_mi.cc: Updating flush_master_info call so that it uses two parameters instead of one. sql/rpl_mi.h: Changed flush_master_info interface. Now takes a second parameter instead of just one. The second parameter is: need_lock_relay_log. sql/rpl_rli.cc: Small fix in comment. sql/slave.cc: Updating flush_master_info call so that it uses two parameters instead of one. sql/sql_repl.cc: Updating flush_master_info call so that it uses two parameters instead of one.
Diffstat (limited to 'sql/rpl_mi.h')
-rw-r--r--sql/rpl_mi.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h
index f822a6bc1b1..363c8d4e0b3 100644
--- a/sql/rpl_mi.h
+++ b/sql/rpl_mi.h
@@ -120,7 +120,9 @@ int init_master_info(Master_info* mi, const char* master_info_fname,
bool abort_if_no_master_info_file,
int thread_mask);
void end_master_info(Master_info* mi);
-int flush_master_info(Master_info* mi, bool flush_relay_log_cache);
+int flush_master_info(Master_info* mi,
+ bool flush_relay_log_cache,
+ bool need_lock_relay_log);
int change_master_server_id_cmp(ulong *id1, ulong *id2);
#endif /* HAVE_REPLICATION */