summaryrefslogtreecommitdiff
path: root/sql/rpl_mi.cc
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@sun.com>2009-09-30 22:41:05 +0100
committerAlfranio Correia <alfranio.correia@sun.com>2009-09-30 22:41:05 +0100
commit9682ff8a26cef6dc2252b6a520f841dcfa62ee20 (patch)
tree841fbd490ed98a831c027a033a7717f857dd41f8 /sql/rpl_mi.cc
parent9581d6280e4261c6246f53d44a7357a96e98c19e (diff)
downloadmariadb-git-9682ff8a26cef6dc2252b6a520f841dcfa62ee20.tar.gz
BUG#43075 rpl.rpl_sync fails sporadically on pushbuild
NOTE: Backporting the patch to next-mr. The slave was crashing while failing to execute the init_slave() function. The issue stems from two different reasons: 1 - A failure while allocating the master info structure generated a segfault due to a NULL pointer. 2 - A failure while recovering generated a segfault due to a non-initialized relay log file. In other words, the mi->init and rli->init were both set to true before executing the recovery process thus creating an inconsistent state as the relay log file was not initialized. To circumvent such problems, we refactored the recovery process which is now executed while initializing the relay log. It is ensured that the master info structure is created before accessing it and any error is propagated thus avoiding to set mi->init and rli->init to true when for instance the relay log is not initialized or the relay info is not flushed. The changes related to the refactory are described below: 1 - Removed call to init_recovery from init_slave. 2 - Changed the signature of the function init_recovery. 3 - Removed flushes. They are called while initializing the relay log and master info. 4 - Made sure that if the relay info is not flushed the mi-init and rli-init are not set to true. In this patch, we also replaced the exit(1) in the fault injection by DBUG_ABORT() to make it compliant with the code guidelines.
Diffstat (limited to 'sql/rpl_mi.cc')
-rw-r--r--sql/rpl_mi.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index cec2eabdd20..fe005bdb2a3 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -310,6 +310,7 @@ file '%s')", fname);
goto err;
mi->inited = 1;
+ mi->rli.is_relay_log_recovery= FALSE;
// now change cache READ -> WRITE - must do this before flush_master_info
reinit_io_cache(&mi->file, WRITE_CACHE, 0L, 0, 1);
if ((error=test(flush_master_info(mi, 1))))