Replication to slave stops with "Error: Duplicate entry"

Replication to the slave keeps on failing. Even if I delete the conflicted entry on the slave and issue START SLAVE, the error pops up after a few seconds.

The slave is not being used for anything right now, not even for reads.

We’re running MySQL 5.0.75, the Percona version with XtraDB. The OS is OpenSolaris.

mysql> show slave status \G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: dp03a
Master_User: repl
Master_Port: 6614
Connect_Retry: 60
Master_Log_File: binlog.002015
Read_Master_Log_Pos: 1530491
Relay_Log_File: relay.000020
Relay_Log_Pos: 8458621
Relay_Master_Log_File: binlog.001553
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1062
Last_Error: Error ‘Duplicate entry ‘206159784376-464033’ for key 2’ on query. Default database: ‘pulse_user48’. Query: ‘INSERT INTO plx_ab_feed (plx_ab_feed.uhid, plx_ab_feed.feed_id, plx_ab_feed.display_id, plx_ab_feed.entry_id, plx_ab_feed.last_updated) VALUES (“206159784376”, “464033”, “”, “54608808”, now())’
Skip_Counter: 0
Exec_Master_Log_Pos: 8458487
Relay_Log_Space: 4880870001
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
1 row in set (0.00 sec)

mysql>

We’re also seeing “Lock wait timeout” errors on a couple of other slaves doing replication. These slaves are doing nothing but replicating the master (so no read from the slaves). They’re also running Percona’s MySQL 5.0.75 with XtraDB build. Supposedly this bug was fixed in 5.0.33 ([URL]MySQL Bugs: #20697: slave fails to rollback replicated transaction hang over innodb_lock_wait_timeou), and we’re wondering if it’s a regression. I don’t know if this problem is related to the Duplicate Key error, but I’m just throwing it in there.

Any ideas what we should look for? Any help would be appreciated. Thanks in advance.

1 Like