|
|||||||||||
|
bk commit into 5.1 tree (aelkin:1.2608) BUG#20435
From: Andrei Elkin <aelkin(at)mysql.com>
Date: Wed Oct 17 2007 - 06:17:03 EDT
ChangeSet@1.2608, 2007-10-17 13:16:57+03:00, aelkin@dsl-hkibras1-ff5fc300-23.dhcp.inet.fi +2 -0 bug#20435 wl#342 heartbeat
expanding possible error message from attempt to set up the period
on the master;
sql/rpl_mi.cc@1.9, 2007-10-17 13:16:53+03:00, aelkin@dsl-hkibras1-ff5fc300-23.dhcp.inet.fi +4 -2 Enforcing the max for heartbeat stays. A flaw (of cosmetic character) was in that the default slave_net_timeout/2 might be bigger than SLAVE_MAX_HEARTBEAT_PERIOD. sql/slave.cc@1.317, 2007-10-17 13:16:53+03:00, aelkin@dsl-hkibras1-ff5fc300-23.dhcp.inet.fi +29 -19 had to refactor error message generation in the function. Heartbeat branch is elaborated on with reporting the exact query and its error. diff -Nrup a/sql/rpl_mi.cc b/sql/rpl_mi.cc --- a/sql/rpl_mi.cc 2007-10-15 16:03:44 +03:00 +++ b/sql/rpl_mi.cc 2007-10-17 13:16:53 +03:00 */ - mi->heartbeat_period= (float) (slave_net_timeout/2.0); - + mi->heartbeat_period= (float) min(SLAVE_MAX_HEARTBEAT_PERIOD, + (slave_net_timeout/2.0)); + DBUG_ASSERT(mi->heartbeat_period > (float) 0.001 + || mi->heartbeat_period == 0);
mi->ssl= master_ssl;
--- a/sql/slave.cc 2007-10-13 23:41:05 +03:00 +++ b/sql/slave.cc 2007-10-17 13:16:53 +03:00 @@ -759,7 +759,9 @@ int init_floatvar_from_file(float* var,
static int get_master_version_and_clock(MYSQL* mysql, MASTER_INFO* mi)
{
+ char error_buf[512]; + String err_msg(error_buf, sizeof(error_buf), &my_charset_bin); + err_msg.length(0); DBUG_ENTER("get_master_version_and_clock");
/*
mi->rli.relay_log.description_event_for_queue= 0; if (!my_isdigit(&my_charset_bin,*mysql->server_version)) - errmsg = "Master reported unrecognized MySQL version"; + err_msg.append("Master reported unrecognized MySQL version");
else
case '0':
case '1':
case '2':
- errmsg = "Master reported unrecognized MySQL version";
+ err_msg.append("Master reported unrecognized MySQL version");
break;
case '3':
mi->rli.relay_log.description_event_for_queue= new
*/
@@ -870,10 +872,10 @@ static int get_master_version_and_clock(
if ((master_row= mysql_fetch_row(master_res)) &&
(::server_id == strtoul(master_row[1], 0, 10)) &&
!mi->rli.replicate_same_server_id)
- errmsg= "The slave I/O thread stops because master and slave have equal \
-MySQL server ids; these ids must be different for replication to work (or \
-the --replicate-same-server-id option must be used on slave but this does \
-not always make sense; please check the manual before using it).";
+ err_msg.append("The slave I/O thread stops because master and slave have equal"
+ " MySQL server ids; these ids must be different for replication to work (or"
+ " the --replicate-same-server-id option must be used on slave but this does"
+ " not always make sense; please check the manual before using it).");
mysql_free_result(master_res);
} @@ -905,9 +907,9 @@ not always make sense; please check the {
if ((master_row= mysql_fetch_row(master_res)) &&
strcmp(master_row[0], global_system_variables.collation_server->name))
- errmsg= "The slave I/O thread stops because master and slave have \
-different values for the COLLATION_SERVER global variable. The values must \
-be equal for replication to work";
+ err_msg.append("The slave I/O thread stops because master and slave have"
+ " different values for the COLLATION_SERVER global variable."
+ " The values must be equal for replication to work");
mysql_free_result(master_res);
} @@ -933,11 +935,10 @@ be equal for replication to work";
if ((master_row= mysql_fetch_row(master_res)) &&
strcmp(master_row[0],
global_system_variables.time_zone->get_name()->ptr()))
- errmsg= "The slave I/O thread stops because master and slave have \
-different values for the TIME_ZONE global variable. The values must \
-be equal for replication to work";
+ err_msg.append("The slave I/O thread stops because master and slave have"
+ " different values for the TIME_ZONE global variable."
+ " The values must be equal for replication to work");
mysql_free_result(master_res);
- goto err; }
if (mi->heartbeat_period != 0.0)
if (mysql_real_query(mysql, query, strlen(query)))
{
- errmsg= "The slave I/O thread stops because querying the master failed";
+ err_msg.append("The slave I/O thread stops because querying master with '");
+ err_msg.append(query);
+ err_msg.append("' failed;");
+ err_msg.append(" error: ");
+ err_msg.qs_append(mysql_errno(mysql));
+ err_msg.append(" '");
+ err_msg.append(mysql_error(mysql));
+ err_msg.append("'");
+ mysql_free_result(mysql_store_result(mysql));
goto err;
}
+ mysql_free_result(mysql_store_result(mysql)); }
err:
{
DBUG_RETURN(1);
-- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived on Wed Oct 17 06:17:20 2007 This archive was generated by hypermail 2.1.8 : Thu Jul 03 2008 - 10:04:04 EDT |
||||||||||
|
|||||||||||