On Mon, Feb 21, 2011 at 09:07, ThorQue <
thorste...@googlemail.com> wrote:
> from time to time I get this exception:
> [2011-02-21 18:01:44,249] ERROR
> com.google.gerrit.server.git.ReceiveCommits : Error creating change
> for commit 2c84de0fac63c147013fdeabf946e53822d84ba5
> com.google.gwtorm.client.OrmException: insert failure on
> patch_set_ancestors
...
> Caused by: java.sql.BatchUpdateException: Duplicate entry '2-1-1' for
> key 'PRIMARY'
..
> Then I try until the primary seems ok. What happen here? I am using
> mac, current gerrit and mysql 5.
When MySQL restarts it loses the current value of the sequence
generators Gerrit uses. I've posted this before, you need to do
something like:
INSERT INTO change_id_seq SELECT MAX(change_id) + 1 FROM changes;
INSERT INTO account_id_seq SELECT MAX(account_id) + 1 FROM accounts;
INSERT INTO account_group_id_seq SELECT MAX(account_group_id) + 1
FROM account_groups;