Slave I/O thread won't attempt to automatically reconnect to the master / error-code 1159
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
|||
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Medium
|
Vlad Lesin | ||
5.1 |
Won't Fix
|
Undecided
|
Vlad Lesin | ||
5.5 |
Fix Released
|
Medium
|
Vlad Lesin | ||
5.6 |
Fix Released
|
Medium
|
Vlad Lesin |
Bug Description
140111 17:06:04 [Note] Slave I/O thread: connected to master 'name@host:
140111 18:57:56 [ERROR] Slave I/O: The slave I/O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master. Error: , Error_code: 1159
The error in question seems to be a network error:
$ perror 1159
MySQL error code 1159 (ER_NET_
Percona Server 5.5.29-29.4 is running on the affected slave. Looking at the source code for that release, the problematic code path appears to be:
1364 if (check_
1365 goto slave_killed_err;
1366 else if (is_network_
1367 {
1368 mi->report(
1369 "Get master SERVER_ID failed with error: %s", mysql_error(
1370 goto network_err;
1371 }
1372 /* Fatal error */
1373 errmsg= "The slave I/O thread stops because a fatal error is encountered \
1374 when it try to get the value of SERVER_ID variable from master.";
1375 err_code= mysql_errno(mysql);
1376 sprintf(err_buff, "%s Error: %s", errmsg, mysql_error(
1377 goto err;
The call to is_network_error on line 1366 determines whether the slave thread automatically restarts. However is_network_error does not return true for ER_NET_
The following patch would fix the issue:
--- a/Percona-
+++ b/Percona-
@@ -1176,7 +1176,8 @@ bool is_network_
errorno == CR_SERVER_
errorno == CR_SERVER_LOST ||
errorno == ER_CON_COUNT_ERROR ||
- errorno == ER_SERVER_SHUTDOWN)
+ errorno == ER_SERVER_SHUTDOWN ||
+ errorno == ER_NET_
return TRUE;
return FALSE;
Related branches
- Laurynas Biveinis (community): Approve
-
Diff: 204 lines (+141/-11)4 files modifiedmysql-test/suite/rpl/r/rpl_percona_gmvac_net_err.result (+30/-0)
mysql-test/suite/rpl/t/rpl_percona_gmvac_net_err.test (+67/-0)
sql-common/client.c (+6/-0)
sql/slave.cc (+38/-11)
- Laurynas Biveinis (community): Approve
-
Diff: 180 lines (+126/-2)4 files modifiedmysql-test/suite/rpl/r/rpl_percona_gmvac_net_err.result (+33/-0)
mysql-test/suite/rpl/t/rpl_percona_gmvac_net_err.test (+67/-0)
sql-common/client.c (+6/-0)
sql/rpl_slave.cc (+20/-2)
summary: |
Slave I/O thread won't attempt to automatically reconnect to the master + / error-code 1159 |
tags: | added: upstream |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PS-1470