Duplicate PRIMARY KEY errors after changing auto_increment settings
Bug #1572157 reported by
monty solomon
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
|||
Percona Server moved to https://jira.percona.com/projects/PS |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
We are getting duplicate primary key errors after changing the auto_increment settings.
We were inserting rows into tables in two (2) databases on separate servers and changed the auto_increment settings on the servers so one of them would use odd values and the other one would use even values for a migration where we didn't want any collisions.
The migration is complete and we changed the auto_increment settings back to the default values and are getting duplicate primary key errors for some INSERT statements.
tags: | added: upstream |
To post a comment you must log in.
How to repeat:
Change the auto_increment settings to use even values and insert many rows into several tables.
SET GLOBAL auto_increment_ increment = 2 ; SET GLOBAL auto_increment_ offset = 2 ;
Change the auto_increment settings back to the standard values and insert rows into the tables.
SET GLOBAL auto_increment_ increment = 1 ; SET GLOBAL auto_increment_ offset = 1 ;
Observe duplicate primary key errors for some INSERT statements.