diff options
author | <Li-Bing.Song@sun.com> | 2010-01-08 13:42:23 +0800 |
---|---|---|
committer | <Li-Bing.Song@sun.com> | 2010-01-08 13:42:23 +0800 |
commit | 8c677779ff7bb45c215fa139f157eb7ffdac0877 (patch) | |
tree | 02c3b5d470c056ddc431efb653a4cdfba1c9172f /mysql-test/include | |
parent | 0597dc7c9c3578f2d3bf0f54e74c17c415c7cf6d (diff) | |
download | mariadb-git-8c677779ff7bb45c215fa139f157eb7ffdac0877.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 'mysql-test/include')
-rw-r--r-- | mysql-test/include/truncate_file.inc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/include/truncate_file.inc b/mysql-test/include/truncate_file.inc new file mode 100644 index 00000000000..c82108681bd --- /dev/null +++ b/mysql-test/include/truncate_file.inc @@ -0,0 +1,16 @@ +# truncate a giving file, all contents of the file are be cleared + +if (`SELECT 'x$file' = 'x'`) +{ + --echo Please assign a file name to $file!! + exit; +} + +let TRUNCATE_FILE= $file; + +perl; +use Env; +Env::import('TRUNCATE_FILE'); +open FILE, '>', $TRUNCATE_FILE || die "Can not open file $file"; +close FILE; +EOF |