Description:
when slave lost connection and reconnect ok by trying three times .
we have a duplicated key occured .
the error_log messages as follow :
051024 22:59:19 mysqld started
051024 22:59:19 [Warning] Changed limits: max_open_files: 1024 max_connections: 512 table_cache: 251
/usr/libexec/mysqld: ready for connections.
Version: '4.1.14-debug-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
051024 22:59:21 [Note] Slave SQL thread initialized, starting replication in log 'ibm17-bin.092' at position 66305083, relay log './ibm171-relay-bin.000429' position: 6523788
051024 22:59:21 [Note] Slave I/O thread: connected to master 'fghj888@192.168.0.17:3306', replication started in log 'ibm17-bin.092' at position 66305083
051027 17:28:36 [Warning] Found invalid password for user: 'jay@192.168.0.%'; Ignoring user
051105 4:01:31 [ERROR] Slave: Error 'Duplicate entry '161709972' for key 1' on query. Default database: 'si2FT'. Query: 'INSERT INTO si2FT_tmp.FT_wagers SELECT * FROM si2FT.FT_wagers WHERE wid=127361370', Error_code: 1062
051105 4:01:31 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'ibm17-bin.161' position 47353447
051105 9:48:02 [Note] Slave SQL thread initialized, starting replication in log 'ibm17-bin.161' at position 47353447, relay log './ibm171-relay-bin.001131' position: 6369303
051105 9:48:02 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
051105 9:48:02 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'ibm17-bin.161' position 47594633
051105 9:48:02 [Note] Slave: connected to master 'fghj888@192.168.0.17:3306',replication resumed in log 'ibm17-bin.161' at position 47594633
051105 9:49:45 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
051105 9:49:45 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'ibm17-bin.161' position 61507167
051105 9:49:45 [Note] Slave: connected to master 'fghj888@192.168.0.17:3306',replication resumed in log 'ibm17-bin.161' at position 61507167
051105 9:57:13 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
051105 9:57:13 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'ibm17-bin.162' position 22443992
051105 9:57:13 [Note] Slave: connected to master 'fghj888@192.168.0.17:3306',replication resumed in log 'ibm17-bin.162' at position 22443992
051106 22:41:47 [ERROR] Slave: Error 'Duplicate entry '163723116' for key 1' on query. Default database: 'si2FT'. Query: 'INSERT INTO si2FT_tmp.FT_wagers SELECT * FROM si2FT.FT_wagers WHERE wid=129396523', Error_code: 1062
051106 22:41:47 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'ibm17-bin.182' position 4933635
051106 23:14:58 [Note] Slave SQL thread initialized, starting replication in log 'ibm17-bin.182' at position 4933635, relay log './ibm171-relay-bin.001332' position: 514579
051106 23:15:01 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
051106 23:15:01 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'ibm17-bin.182' position 5185000
051106 23:15:01 [Note] Slave: connected to master 'fghj888@192.168.0.17:3306',replication resumed in log 'ibm17-bin.182' at position 5185000
051106 23:15:02 [ERROR] Slave: Error 'Duplicate entry '163723116' for key 1' on query. Default database: 'si2FT'. Query: 'INSERT INTO si2FT_tmp.FT_wagers SELECT * FROM si2FT.FT_wagers WHERE wid=129396523', Error_code: 1062
051106 23:15:02 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'ibm17-bin.182' position 4962957
051106 23:15:12 [Note] Slave SQL thread initialized, starting replication in log 'ibm17-bin.182' at position 4962957, relay log './ibm171-relay-bin.001332' position: 545071
051106 23:18:03 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
051106 23:18:03 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'ibm17-bin.182' position 24685974
051106 23:18:03 [Note] Slave: connected to master 'fghj888@192.168.0.17:3306',replication resumed in log 'ibm17-bin.182' at position 24685974
051106 23:20:45 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
051106 23:20:45 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'ibm17-bin.182' position 44822129
051106 23:20:45 [Note] Slave: connected to master 'fghj888@192.168.0.17:3306',replication resumed in log 'ibm17-bin.182' at position 44822129
051106 23:23:27 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
051106 23:23:27 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'ibm17-bin.182' position 64949285
051106 23:23:27 [Note] Slave: connected to master 'fghj888@192.168.0.17:3306',replication resumed in log 'ibm17-bin.182' at position 64949285
051106 23:26:18 [ERROR] Error reading packet from server: Lost connection to MySQL server during query (server_errno=2013)
051106 23:26:18 [ERROR] Slave I/O thread: Failed reading log event, reconnecting to retry, log 'ibm17-bin.182' position 86432654
051106 23:26:18 [Note] Slave: connected to master 'fghj888@192.168.0.17:3306',replication resumed in log 'ibm17-bin.182' at position 86432654
051107 12:02:52 [ERROR] Slave: Error 'Duplicate entry '161709972' for key 1' on query. Default database: 'si2FT'. Query: 'insert into si2FT_tmp.FT_wagers select * from FT_wagers where gdate <'2005-11-05'', Error_code: 1062
051107 12:02:52 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'ibm17-bin.187' position 62525055
051107 13:37:40 [Note] Slave SQL thread initialized, starting replication in log 'ibm17-bin.187' at position 62525055, relay log './ibm171-relay-bin.001389' position: 8880685
##############################
How to repeat:
master :
os : Linux ibm17.iq2003.com 2.4.21-27.0.2.ELsmp #1 SMP Wed Jan 12 23:35:44 EST 2005 i686 i686 i386 GNU/Linux
mysql : mysqladmin Ver 8.23 Distrib 3.23.58, for redhat-linux-gnu on i386
slave :
os : Linux ibm171.iq2003.com 2.6.9-11.ELsmp #1 SMP Fri May 20 18:26:27 EDT 2005 i686 i686 i386 GNU/Linux
mysql :mysqladmin Ver 8.41 Distrib 4.1.14, for pc-linux-gnu on i686