summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorunknown <Li-Bing.Song@sun.com>2010-01-08 13:42:23 +0800
committerunknown <Li-Bing.Song@sun.com>2010-01-08 13:42:23 +0800
commitc1043021c81a4394b5aa9961d7106c437275b040 (patch)
tree02c3b5d470c056ddc431efb653a4cdfba1c9172f /sql/sql_repl.cc
parent4d090ed4f396b0c24770eafe66f630c3dcdff8fd (diff)
downloadmariadb-git-c1043021c81a4394b5aa9961d7106c437275b040.tar.gz
BUG #28421 Infinite loop on slave relay logs
Manually deleteing one or more entries from 'master-bin.index', will cause master infinitely loop to send one binlog file. When starting a dump session, master opens index file and search the binlog file which is being requested by the slave. The position of the binlog file in the index file is recorded. it will be used to find the next binlog file when current binlog file has dumped completely. As only the position is used, it may not get the correct file if some entries has been removed manually from the index file. the master will reopen the current binlog file which has been dump completely and redump it if it can not get the next binlog file's name from index file. It obviously is a logical error. Even though it is allowed to manually change index file, but it is not recommended. so after this patch, master sends a fatal error to slave and close the dump session if a new binlog file has been generated and master can not get it from the index file.
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index b8f2e1e39bf..de038f8dc2c 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -711,11 +711,14 @@ impossible position";
thd_proc_info(thd, "Finished reading one binlog; switching to next binlog");
switch (mysql_bin_log.find_next_log(&linfo, 1)) {
- case LOG_INFO_EOF:
- loop_breaker = (flags & BINLOG_DUMP_NON_BLOCK);
- break;
case 0:
break;
+ case LOG_INFO_EOF:
+ if (mysql_bin_log.is_active(log_file_name))
+ {
+ loop_breaker = (flags & BINLOG_DUMP_NON_BLOCK);
+ break;
+ }
default:
errmsg = "could not find next log";
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;