Hello,
Occasionally we encounter an issue in our Gerrit installation where a sequence of changes (as determined by the "depends on"/"included in" UI feature of Gerrit) get stuck in a "Submitted, Merge Pending" state. When this happens we can usually fix things by abandoning the "earliest" (first in the "depends on" sequence) commit, re-submitting the "second", and then restoring and re-submitting the first.
What can we do to prevent this from happening? When the problem occurs we typically see errors like the following in Gerrit's logs:
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '114073-3-1' for key 'PRIMARY'
at sun.reflect.GeneratedConstructorAccessor243.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1040)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2468)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2629)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2719)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2450)
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2006)
... 28 more
[2013-12-10 13:44:25,765] ERROR com.google.gerrit.server.git.ChangeMergeQueue : Merge attempt for PROJECT_NAME,refs/heads/BRANCH_NAME failed
com.google.gerrit.server.git.MergeException: Cannot merge b37fbee315d2dff0775894b87a718586c9876ab5
Additionally, the most recent time that this happened, we saw the following:
[2013-12-10 13:52:55,219] WARN / : Error in rebaseChange
com.google.gwtorm.server.OrmException: insert failure on patch_set_ancestors
Thanks,
-Jason