Issue 1118: MySQL - Duplicate key Change Id
Status:  Duplicate
Merged:  issue 518
Owner: ----
Closed:  Aug 2011
Reported by dreed10, Aug 30, 2011
Affected Version:

What steps will reproduce the problem?
- Not sure how to reproduce this but it's happened to us three times over the last month.  When trying to push a change to Gerrit the push fails with a database error.  The error is thrown because the auto increment value on the Change Id table gets out of sync.  Manually setting the value fixes the issue for a while. 


Please provide any additional information below.

        at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:324)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.sql.BatchUpdateException: Duplicate entry '316-1-1' for key 'PRIMARY'
        at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2007)
        at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1443)
        at com.google.gwtorm.jdbc.JdbcAccess.execute(JdbcAccess.java:293)
        at com.google.gwtorm.jdbc.JdbcAccess.doInsert(JdbcAccess.java:171)
Aug 30, 2011
#1 sop@google.com
This happens when the MySQL server is restarted. We fixed it in Gerrit 2.1.8 and 2.2.2.
Status: Duplicate
Labels: FixedIn-2.2.2
Mergedinto: 518
Sep 19, 2011
#2 rajinder...@gmail.com
How can I checkout 2.2.2. There's no tag for this version.
Sep 19, 2011
Project Member #3 edwin.ke...@gmail.com
As far as I know Gerrit 2.2.2 is not released yet. This is why there is no tag for this version yet. The Gerrit 2.2.2 development is done in the master branch, so you might want to checkout this branch, but this branch contains the current development state and not a released version of Gerrit.