mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug #42914 Log event that larger than max_allowed_packet results in stop of slave I/O thread,
But there is no Last_IO_Error reported. On the master, if a binary log event is larger than max_allowed_packet, ER_MASTER_FATAL_ERROR_READING_BINLOG and the specific reason of this error is sent to a slave when it requests a dump from the master, thus leading the I/O thread to stop. On a slave, the I/O thread stops when receiving a packet larger than max_allowed_packet. In both cases, however, there was no Last_IO_Error reported. This patch adds code to report the Last_IO_Error and exact reason before stopping the I/O thread and also reports the case the out memory pops up while handling packets from the master. sql/sql_repl.cc: The master send the Specific reasons instead of "error reading log entry" to the slave which is requesting a dump. if an fatal error is returned by read_log_event function.
This commit is contained in:
@ -623,7 +623,7 @@ impossible position";
|
||||
*/
|
||||
{
|
||||
log.error=0;
|
||||
bool read_packet = 0, fatal_error = 0;
|
||||
bool read_packet = 0;
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
if (max_binlog_dump_events && !left_events--)
|
||||
@ -645,7 +645,7 @@ impossible position";
|
||||
*/
|
||||
|
||||
pthread_mutex_lock(log_lock);
|
||||
switch (Log_event::read_log_event(&log, packet, (pthread_mutex_t*)0)) {
|
||||
switch (error= Log_event::read_log_event(&log, packet, (pthread_mutex_t*) 0)) {
|
||||
case 0:
|
||||
/* we read successfully, so we'll need to send it to the slave */
|
||||
pthread_mutex_unlock(log_lock);
|
||||
@ -671,8 +671,8 @@ impossible position";
|
||||
|
||||
default:
|
||||
pthread_mutex_unlock(log_lock);
|
||||
fatal_error = 1;
|
||||
break;
|
||||
test_for_non_eof_log_read_errors(error, &errmsg);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (read_packet)
|
||||
@ -701,12 +701,6 @@ impossible position";
|
||||
*/
|
||||
}
|
||||
|
||||
if (fatal_error)
|
||||
{
|
||||
errmsg = "error reading log entry";
|
||||
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
|
||||
goto err;
|
||||
}
|
||||
log.error=0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user