Bug #9325 Many Errors "Slave: received end packet from server"
Submitted: 22 Mar 2005 4:52 Modified: 25 Jun 2005 8:48
Reporter: Michael Zimmermann Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:4.1.10a OS:Linux (Linux (SuSE 9.1))
Assigned to: CPU Architecture:Any

[22 Mar 2005 4:52] Michael Zimmermann
Description:
In a simple replication-setup with one master and one slave the error-log on the slave is overfull of 
"[ERROR] Slave: received end packet from server, apparent master shutdown" plus the corresponding retries to connect. Serveral such errors per second are not uncommon.

This error seems to be introduced into the recent 4.1.x Versions, but I'm not sure, which version started producing it. It's observable with 4.1.10 and 4.1.10a (older RPMs are no longer available
here).

If you need more info or want me to test something (including an older or newer version),
I'll be happy to help.

Michael <zim@vegaa.de>

How to repeat:
Simply set up a replication.

my.cnf on master:
------------------------------------------------

# o3 mysql configuration

[client]
port            = 1006
socket          = /mysql/data/mysql.sock

[mysqld]
port            = 1006
socket          = /mysql/data/mysql.sock
skip-locking
skip-innodb
set-variable    = key_buffer=16M
set-variable    = max_allowed_packet=16M
set-variable    = table_cache=64
set-variable    = sort_buffer=512K
set-variable    = net_buffer_length=8K
set-variable    = myisam_sort_buffer_size=8M
# Allow small words in full-text indexes (for bugzilla)
ft_min_word_len = 2
log
log-error
log-bin
log-slave-updates
log_slow_queries
long_query_time=1
server-id       = 13

[safe_mysqld]
err-log=/mysql/mysqld.log
port            = 1006
socket          = /mysql/data/mysql.sock

[mysqldump]
quick
set-variable    = max_allowed_packet=16M

[mysql]
no-auto-rehash

[isamchk]
set-variable    = key_buffer=20M
set-variable    = sort_buffer=20M
set-variable    = read_buffer=2M
set-variable    = write_buffer=2M

[myisamchk]
set-variable    = key_buffer=20M
set-variable    = sort_buffer=20M
set-variable    = read_buffer=2M
set-variable    = write_buffer=2M

[mysqlhotcopy]
interactive-timeout

my.cnf on slave:
------------------------------------------------------

# o2 mysql configuration

[client]
port            = 1006
socket          = /mysql/data/mysql.sock

[mysqld]
port            = 1006
socket          = /mysql/data/mysql.sock
skip-locking    
skip-innodb
set-variable    = key_buffer=16M
set-variable    = max_allowed_packet=16M
set-variable    = table_cache=64 
set-variable    = sort_buffer=512K
set-variable    = net_buffer_length=8K
set-variable    = myisam_sort_buffer_size=8M
# Allow small words in full-text indexes (for bugzilla)
ft_min_word_len = 2
log
log-error
log-bin
log_slow_queries
long_query_time=1 
server-id       = 12
master-host=o3.4optimal.de
master-user=repl
master-password=xxxxx
master-port=1006

[safe_mysqld]
err-log=/mysql/mysqld.log
port            = 1006
socket          = /mysql/data/mysql.sock

[mysqldump]
quick
set-variable    = max_allowed_packet=16M

[mysql]
no-auto-rehash

[isamchk]
set-variable    = key_buffer=20M
set-variable    = sort_buffer=20M
set-variable    = read_buffer=2M
set-variable    = write_buffer=2M

[myisamchk]
set-variable    = key_buffer=20M
set-variable    = sort_buffer=20M
set-variable    = read_buffer=2M
set-variable    = write_buffer=2M

[mysqlhotcopy]
interactive-timeout
[22 Mar 2005 5:00] Michael Zimmermann
As a consequence of the many errors and reconnects, replication speed is extremely low.
Although the servers are under very low load (master has about 20 queries per second),
it happens several times a day that the slave is 10 minutes or more behind the master.
That's why I consider the bug to be serious.
[24 Jun 2005 12:31] MySQL Verification Team
Could you please verify if actually you are using the same port for
master and slave. You can't to use the same port. 

my.cnf on slave:
------------------------------------------------------

# o2 mysql configuration

[client]
port            = 1006
socket          = /mysql/data/mysql.sock

[mysqld]
port            = 1006
<cut>
master-port=1006
[25 Jun 2005 8:48] Michael Zimmermann
This error happened, because due to a script-error other MySQL-Servers happened to use the same my.cnf config-file and therefore we had more than one slave contacting to the master WITH AN IDENTICAL SERVER-ID.

Sorry for this erronuous Bug-Report. Thanks to Jeremy D. Zawodny and Derrek J. Balling for their excellent book "High Performance MySQL", which describes the problem.
[25 Jun 2005 8:52] Michael Zimmermann
@Miguel Solorzano

Of course one can used the same port for master and slave. That was a misunderstanding on your side. Greetings.