Bug #17684 | Replication Breaks due to Duplicate Key of ID 0 | ||
---|---|---|---|
Submitted: | 24 Feb 2006 1:05 | Modified: | 6 May 2006 16:19 |
Reporter: | Eric Filson | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 5.0.18 | OS: | Linux (Linux RHE 4) |
Assigned to: | CPU Architecture: | Any |
[24 Feb 2006 1:05]
Eric Filson
[24 Feb 2006 12:59]
Valeriy Kravchuk
Thank you for a problem report. Are both your master and slave running on 5.0.18? Are you sure your tables are identical, and has the same data in them initially? To put it short: Can you provide a set of statements (starting with CREATE TABLE) that demonstrates this behaviour each and every time?
[25 Feb 2006 3:40]
Eric Filson
Yes, both Master and Slave are running 5.0.18 and the Master and Slave have identical initial data. They are also running identical OSs and configurations for all libraries, scripts, and software. This problem does not happen everytime the query is run, it's very inconsistant. I have changed the query to read: INSERT INTO table_name (table_name_id) VALUES (0) ON DUPLICATE KEY UPDATE table_name_id=0; This issue has not repeated itself since the command was changed around 20 hours ago. I will continue to monitor and post results here in 48 hours. I will also mysqldump and compare both data sets and report any inconsistancies for the same report. Hope all this helps.
[25 Feb 2006 15:15]
Valeriy Kravchuk
Thank you for the additional information. Please, inform about your further findings.
[2 Mar 2006 1:35]
Eric Filson
With the statement changed to add: INSERT INTO table_name (table_name_id) VALUES (0) ON DUPLICATE KEY UPDATE table_name_id=0; One of the errors disappears. I realized that I was receiving a seperate error for high concurrency tables as opposed to low concurrency tables. High concurrency tables were returning the error: 060223 17:37:00 [ERROR] Slave: Error 'Duplicate entry '0' for key 1' on query. Default database: 'any_database'. Query: ' INSERT INTO table_name (table_name_id) VALUES (0)', Error_code: 1062 The low concurrency tables were returning the error: 060223 17:37:00 [ERROR] Slave: Error 'Duplicate entry 'XXXXXXX' for key 1' on query. Default database: 'any_database'. Query: ' INSERT INTO table_name (table_name_id) VALUES (0)', Error_code: 1062 After adding in the additional: ON DUPLICATE... The error for low concurrency tables which always includes an actual value for the key disappears. The only error remaining is the high concurrency table with the id field value returning a 0. Which is even more mysterious :P If you would like I can provide the binary log files. I would recommend creating a work around for this problem by adding something like: ON DUPLICATE KEY DO NOT UPDATE This would at least allow the replication NOT to break. This would be of HUGE help. Right now I have had to shut off tracking on my visitor table... Please let me know what else I can provide you with in order to help you trouble shoot this issue.
[6 Apr 2006 16:19]
Valeriy Kravchuk
Sorry for a long delay with porcessing this bug report. Please, try to repeat with a newer version of master and slave, 5.0.19. If the problem is still repeatable, I will need either a repeatable test case (right mix of INSERTs and UPDATEs) or a binary log that is not properly replicated, from your master.
[6 May 2006 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".