mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
better error message in replication when packet is too large
sql/mini_client.cc: pass along ER_NET_PACKET_TOO_LARGE sql/slave.cc: better error message when the packet is too large in slave thread
This commit is contained in:
@@ -330,8 +330,14 @@ mc_net_safe_read(MYSQL *mysql)
|
||||
if(errno != EINTR)
|
||||
{
|
||||
mc_end_server(mysql);
|
||||
net->last_errno=CR_SERVER_LOST;
|
||||
strmov(net->last_error,ER(net->last_errno));
|
||||
if(net->last_errno != ER_NET_PACKET_TOO_LARGE)
|
||||
{
|
||||
net->last_errno=CR_SERVER_LOST;
|
||||
strmov(net->last_error,ER(net->last_errno));
|
||||
}
|
||||
else
|
||||
strmov(net->last_error, "Packet too large - increase \
|
||||
max_allowed_packet on this server");
|
||||
}
|
||||
return(packet_error);
|
||||
}
|
||||
|
||||
12
sql/slave.cc
12
sql/slave.cc
@@ -1293,9 +1293,19 @@ try again, log '%s' at postion %s", RPL_LOG_NAME,
|
||||
sql_print_error("Slave thread killed while reading event");
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (event_len == packet_error)
|
||||
{
|
||||
if(mc_mysql_errno(mysql) == ER_NET_PACKET_TOO_LARGE)
|
||||
{
|
||||
sql_print_error("Log entry on master is longer than \
|
||||
max_allowed_packet on slave. Slave thread will be aborted. If the entry is \
|
||||
really supposed to be that long, restart the server with a higher value of \
|
||||
max_allowed_packet. The current value is %ld", max_allowed_packet);
|
||||
goto err;
|
||||
}
|
||||
|
||||
thd->proc_info = "Waiting to reconnect after a failed read";
|
||||
if(mysql->net.vio)
|
||||
vio_close(mysql->net.vio);
|
||||
|
||||
Reference in New Issue
Block a user