1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#17402313 DUMP THREAD SENDS SOME EVENTS MORE THAN ONCE

Dump thread may encounter an error when reading events from the active binlog
file. However the errors may be temporary, so dump thread will try to read
the event again. But dump thread seeked to an wrong position, it caused some
events was sent twice.

To fix the bug, prev_pos is defined out the while loop and is set the correct
position after reading every event correctly.

This patch also make binlog_can_be_corrupted more accurate, only the binlogs
not closed normally are marked binlog_can_be_corrupted.

Finally, two warnings are added when dump threads encounter the temporary
errors.
This commit is contained in:
Libing Song
2013-09-10 09:35:49 +08:00
parent cdec34bcd0
commit d5fdf9ef88
2 changed files with 54 additions and 8 deletions

View File

@ -1027,6 +1027,17 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet,
if (log_file_name_arg)
*is_binlog_active= mysql_bin_log.is_active(log_file_name_arg);
DBUG_EXECUTE_IF("dump_fake_io_error",
{
if (log_lock)
{
pthread_mutex_unlock(log_lock);
DBUG_SET("-d,dump_fake_io_error");
DBUG_RETURN(LOG_READ_IO);
}
});
if (my_b_read(file, (uchar*) buf, sizeof(buf)))
{
/*