Bug #8837 Error reading packet from server: Lost connection toMySQL server during query
Submitted: 28 Feb 2005 6:24 Modified: 21 May 2005 1:26
Reporter: Armin Lorenz Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.1.7 OS:Windows (Windows 2000 Server)
Assigned to: CPU Architecture:Any

[28 Feb 2005 6:24] Armin Lorenz
Description:
I have the problem with a 4.1.7 slave to a 3.23.51 master:

050220 17:00:03 [ERROR] Error reading packet from server: Lost connection to
MySQL server during query (server_errno=2013)
050220 17:00:03 [ERROR] Slave I/O thread: Failed reading log event, reconnecting
to retry, log 'xxxxxxxx3-bin.446' position 73
050220 17:00:03 [Note] Slave: connected to master
'xxxxxxxx2_slave@xxxxxxxx3:3306',replication resumed in log 'xxxxxxxx3-bin.446'
at position 73
050220 18:00:04 [ERROR] Error reading packet from server: Lost connection to
MySQL server during query (server_errno=2013)
050220 18:01:04 [ERROR] Slave I/O thread: Failed reading log event, reconnecting
to retry, log 'xxxxxxxx3-bin.446' position 73
050220 18:01:04 [Note] Slave: connected to master
'xxxxxxxx2_slave@xxxxxxxx3:3306',replication resumed in log 'xxxxxxxx3-bin.446'
at position 73
050220 19:01:05 [ERROR] Error reading packet from server: Lost connection to
MySQL server during query (server_errno=2013)
050220 19:02:05 [ERROR] Slave I/O thread: Failed reading log event, reconnecting
to retry, log 'xxxxxxxx3-bin.446' position 73
050220 19:02:05 [Note] Slave: connected to master
'xxxxxxxx2_slave@xxxxxxxx3:3306',replication resumed in log 'xxxxxxxx3-bin.446'
at position 73
050220 20:02:06 [ERROR] Error reading packet from server: Lost connection to
MySQL server during query (server_errno=2013)
050220 20:03:06 [ERROR] Slave I/O thread: Failed reading log event, reconnecting
to retry, log 'xxxxxxxx3-bin.446' position 73
050220 20:03:06 [Note] Slave: connected to master
'xxxxxxxx2_slave@xxxxxxxx3:3306',replication resumed in log 'xxxxxxxx3-bin.446'
at position 73
050220 22:00:02 [ERROR] Error reading packet from server: Lost connection to
MySQL server during query (server_errno=2013)
050220 22:00:02 [ERROR] Slave I/O thread: Failed reading log event, reconnecting
to retry, log 'xxxxxxxx3-bin.447' position 73
050220 22:00:03 [Note] Slave: connected to master
'xxxxxxxx2_slave@xxxxxxxx3:3306',replication resumed in log 'xxxxxxxx3-bin.447'
at position 73

How to repeat:
Let the replication run with a 4.1.7 slave to a 3.23.51 master. Currently i have two slaves with 4.1.7 against the 3.23.51 master with the same error messages.
[1 Mar 2005 19:48] Jorge del Conde
MySQL 3.23.X is not supported anymore.  We suggest you upgrade your master to a 4.1.x distribution.
[1 Mar 2005 22:15] Dean Ellis
Of course, if there is a bug and it is 4.1 we do want to fix that. :)

Please check that your slaves have different server-ids.  If they have the same server-id, they may be causing each other to be disconnected.  Otherwise, we will need to see the my.cnf configuration for all servers so we can attempt to reproduce this.
[3 Mar 2005 12:57] Armin Lorenz
Alll the server have different Server IDs:

Master ini

basedir=D:/quadrorm/mysql
datadir=D:/quadrorm/mysql/data
set-variable=max_connections=1000
set-variable=key_buffer=64M
set-variable=table_cache=256
set-variable=sort_buffer=4M
log-bin
binlog-do-db=ipc_tlm
server-id=1

Slave 1 ini

[client]
port=3307
[mysqld]
port=3307
basedir=C:/Program Files/MySQL/MySQL Server 4.1/
datadir=D:/ipc/MySQLData/data/
default-character-set=latin1
default-storage-engine=INNODB
max_connections=1000
query_cache_size=13M
table_cache=1022
tmp_table_size=16M
thread_cache=25
myisam_max_sort_file_size=100G
myisam_max_extra_sort_file_size=100G
myisam_sort_buffer_size=8M
key_buffer_size=19M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=208K
log-bin
innodb_data_home_dir=D:/ipc/MySQLData/
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=34M
innodb_log_file_size=10M
innodb_thread_concurrency=8
master-host=XXXXXX
master-user=XXXXXX_slave
master-password=xxxxx
server-id=3
replicate-do-db=ipc_tlm
replicate-ignore-table=ipc_tlm.tblshowconfig
replicate-ignore-table=ipc_tlm.tblshowhostsconfig
replicate-ignore-table=ipc_tlm.tblshowhostsprocesses
replicate-ignore-table=ipc_tlm.tblstatusorder
replicate-ignore-table=ipc_tlm.tblstatustools

Slave 2 ini

[client]
port=3307
[mysqld]
port=3307
basedir=C:/Program Files/MySQL/MySQL Server 4.1/
datadir=D:/ipc/MySQLData/data/
default-character-set=latin1
default-storage-engine=INNODB
max_connections=1000
query_cache_size=13M
table_cache=1022
tmp_table_size=16M
thread_cache=25
myisam_max_sort_file_size=100G
myisam_max_extra_sort_file_size=100G
myisam_sort_buffer_size=8M
key_buffer_size=19M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=208K
innodb_data_home_dir=D:/ipc/MySQLData/
innodb_additional_mem_pool_size=2M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=34M
innodb_log_file_size=10M
innodb_thread_concurrency=8
master-host=XXXXXX
master-user=XXXXXX_slave
master-password=xxxxx
server-id=4
replicate-do-db=ipc_tlm
replicate-ignore-table=ipc_tlm.tblshowconfig
replicate-ignore-table=ipc_tlm.tblshowhostsconfig
replicate-ignore-table=ipc_tlm.tblshowhostsprocesses
replicate-ignore-table=ipc_tlm.tblstatusorder
replicate-ignore-table=ipc_tlm.tblstatustools
[3 Apr 2005 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[4 Apr 2005 16:45] Sergei Golubchik
reopened
[19 Apr 2005 15:11] Doyle Rivers
The same problem occurs on my system.

Affected System (Slave): 
MySQL 4.1.9-nt
=my.ini=
[mysqld]
port=3306
server-id=2
log-warnings
report-host=server02
replicate-ignore-db=mysql

Unaffected System (Slave):
MySQL 4.1.9-standard - Darwin 7.5.0
=my.cnf=
[mysqld]
log-bin=binarylog
server-id=3
report-host=server03
binlog-ignore-db=mysql

Master 
MySQL 4.0.18-standard-log - Darwin 7.5.0
=my.cnf=
[mysqld]
new
log-bin=binarylog
server-id=1
report-host=server01
binlog-ignore-db=mysql

Logfile Snippet from server02 (Affected Slave)

050419  4:52:17 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
050419  4:52:17 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'binarylog.099' position 1028
050419  4:52:17 [Note] Slave: connected to master 'repl@flashweb:3306',replication resumed in log 'binarylog.099' at position 1028
050419  5:52:18 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
050419  5:52:18 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'binarylog.099' position 1028
050419  5:52:18 [Note] Slave: connected to master 'repl@flashweb:3306',replication resumed in log 'binarylog.099' at position 1028
050419  6:52:18 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
050419  6:52:18 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'binarylog.099' position 1028
050419  6:52:18 [Note] Slave: connected to master 'repl@flashweb:3306',replication resumed in log 'binarylog.099' at position 1028
050419  7:52:19 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
050419  7:52:19 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'binarylog.099' position 1028
050419  7:52:19 [Note] Slave: connected to master 'repl@flashweb:3306',replication resumed in log 'binarylog.099' at position 1028
[21 May 2005 1:26] MySQL Verification Team
I was unable to repeat with 3.23.58 as master and 4.1.12 as slave even
InnoDB launchs the below message at first start:

C:\slave\bin>mysqld-nt --defaults-file=c:\slave\my.ini --standalone --console
InnoDB: Resetting space id's in the doublewrite buffer
050520 22:15:15  InnoDB: Started; log sequence number 0 43892
InnoDB: You are upgrading to an InnoDB version which allows multiple
InnoDB: tablespaces. Wait that purge and insert buffer merge run to
InnoDB: completion...
InnoDB: Full purge and insert buffer merge completed.
InnoDB: You have now successfully upgraded to the multiple tablespaces
InnoDB: format. You should NOT DOWNGRADE to an earlier version of
InnoDB: InnoDB! But if you absolutely need to downgrade, see
InnoDB: http://dev.mysql.com/doc/mysql/en/Multiple_tablespaces.html
InnoDB: for instructions.
mysqld-nt: ready for connections.
Version: '4.1.12-nt-log'  socket: ''  port: 3307  Official MySQL binary
050520 22:15:18 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log '.\light-relay-bin.000001' position: 4
050520 22:15:19 [Note] Slave I/O thread: connected to master 'miguel@localhost:3306',  replication started in log 'FIRST' at position 4

I will need more information for to repeat the behavior reported involving
databases schema and queries, just playing on my own can't to reproduce.
[23 May 2005 6:25] Armin Lorenz
I have upgraded the master to 4.1.x during the last months. I am sorry but i cannot give any hints anymore.