mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Fix for bug #24192 "MySQL replication does not exit server when running out of memory"
In case of out-of-memory error received from the master, print the corresponding message to the error log and stop slave I/O thread to avoid reconnecting with a wrong binary log position. sql/slave.cc: In case of out-of-memory error received from the master, print the corresponding message to the error log and stop slave I/O thread to avoid reconnecting with a wrong binary log position.
This commit is contained in:
parent
dc9b20a603
commit
8abc8b9dc7
1 changed files with 17 additions and 13 deletions
30
sql/slave.cc
30
sql/slave.cc
|
|
@ -26,6 +26,7 @@
|
||||||
#include <my_dir.h>
|
#include <my_dir.h>
|
||||||
#include <sql_common.h>
|
#include <sql_common.h>
|
||||||
#include <errmsg.h>
|
#include <errmsg.h>
|
||||||
|
#include <mysys_err.h>
|
||||||
|
|
||||||
#define MAX_SLAVE_RETRY_PAUSE 5
|
#define MAX_SLAVE_RETRY_PAUSE 5
|
||||||
bool use_slave_mask = 0;
|
bool use_slave_mask = 0;
|
||||||
|
|
@ -3610,22 +3611,25 @@ after reconnect");
|
||||||
|
|
||||||
if (event_len == packet_error)
|
if (event_len == packet_error)
|
||||||
{
|
{
|
||||||
uint mysql_error_number= mysql_errno(mysql);
|
uint mysql_error_number= mysql_errno(mysql);
|
||||||
if (mysql_error_number == CR_NET_PACKET_TOO_LARGE)
|
switch (mysql_error_number) {
|
||||||
{
|
case CR_NET_PACKET_TOO_LARGE:
|
||||||
sql_print_error("\
|
sql_print_error("\
|
||||||
Log entry on master is longer than max_allowed_packet (%ld) on \
|
Log entry on master is longer than max_allowed_packet (%ld) on \
|
||||||
slave. If the entry is correct, restart the server with a higher value of \
|
slave. If the entry is correct, restart the server with a higher value of \
|
||||||
max_allowed_packet",
|
max_allowed_packet",
|
||||||
thd->variables.max_allowed_packet);
|
thd->variables.max_allowed_packet);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
case ER_MASTER_FATAL_ERROR_READING_BINLOG:
|
||||||
if (mysql_error_number == ER_MASTER_FATAL_ERROR_READING_BINLOG)
|
sql_print_error(ER(mysql_error_number), mysql_error_number,
|
||||||
{
|
mysql_error(mysql));
|
||||||
sql_print_error(ER(mysql_error_number), mysql_error_number,
|
goto err;
|
||||||
mysql_error(mysql));
|
case EE_OUTOFMEMORY:
|
||||||
goto err;
|
case ER_OUTOFMEMORY:
|
||||||
}
|
sql_print_error("\
|
||||||
|
Stopping slave I/O thread due to out-of-memory error from master");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
|
mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT;
|
||||||
thd->proc_info = "Waiting to reconnect after a failed master event read";
|
thd->proc_info = "Waiting to reconnect after a failed master event read";
|
||||||
#ifdef SIGNAL_WITH_VIO_CLOSE
|
#ifdef SIGNAL_WITH_VIO_CLOSE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue