•  
      request #3240 SQL errors when migrating repo to Gerrit
    Infos
    #3240
    Patrick Renaud (patrick.renaud)
    2013-05-09 18:00
    2013-05-01 19:28
    2061
    Details
    SQL errors when migrating repo to Gerrit
    Not sure if you have noticed but several SQL errors are reported when a project is migrated to Gerrit. Here is as example:

    STATEMENT: INSERT INTO account_group_members (account_id, group_id) SELECT A.account_id, G.group_id FROM account_external_ids A, account_groups G WHERE A.external_id='username:evlacan' AND G.name='patrick/testers-2'
    ERROR: duplicate key value violates unique constraint "account_group_members_pkey"
    DETAIL: Key (account_id, group_id)=(1000008, 13) already exists.
    STATEMENT: INSERT INTO account_group_members (account_id, group_id) SELECT A.account_id, G.group_id FROM account_external_ids A, account_groups G WHERE A.external_id='username:lmcnale' AND G.name='patrick/testers-2'
    ERROR: duplicate key value violates unique constraint "account_group_members_pkey"
    DETAIL: Key (account_id, group_id)=(1000000, 13) already exists.
    STATEMENT: INSERT INTO account_group_members (account_id, group_id) SELECT A.account_id, G.group_id FROM account_external_ids A, account_groups G WHERE A.external_id='username:lmcpare' AND G.name='patrick/testers-2'
    ERROR: duplicate key value violates unique constraint "account_group_members_pkey"
    DETAIL: Key (account_id, group_id)=(1000010, 13) already exists.
    STATEMENT: INSERT INTO account_group_members (account_id, group_id) SELECT A.account_id, G.group_id FROM account_external_ids A, account_groups G WHERE A.external_id='username:lmcpcar' AND G.name='patrick/testers-2'

    I suspect this happens because Tuleap brutally attempts to add users to groups without first checking if the said users are already members of the target group. Luckily this causes no harm to the data integrity but it should be avoided.

    This happens when migrating subsequent repos from a given project. Obviously it does not happen when migrating the very first repo of a project.
    SCM/Gerrit
    6.0
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    patricia.carrasco@ericsson.com, vladimir.cantiru@ericsson.com
    Stage
    Manuel Vacelet (vaceletm)
    Closed
    2013-05-07
    Attachments
    Empty
    References

    Follow-ups

    User avatar
    An variation of this scenario can provoke the same SQL errors. The new scenario requires conflicting changes made directly to a group membership in Gerrit. This is not a showstopper but I will raise a new high severity bug report to cover it so we can correct this is a subsequent Tuleap release.
    User avatar
    This bug is fixed in Tuleap 6

    • Status changed from New to Closed
    • Assigned to changed from None to Manuel Vacelet (vaceletm)
    • Reported in version changed from 5.12 to 6.0
    • Close date set to 2013-05-07
    User avatar
    Because our Gerrit is fairly busy serving over 4000 users and rapidly growing. We don't want to send garbage data to the system if we can avoid it as it will cause numerous error messages in the database log that will generate false alerts, causing unneeded maintenance efforts.

    Furthemore, we don't want to run the risk of having the db server not trapping the key violation and start adding erroneous entries in the tables.

    We hope it is fairly simple to compute ahead the manipulations that are needed to the membership of a Gerrit group and perform only the needed changes instead of brutally adding ALL wanted members the way it is done now, hoping we won't end up with duplicates....
    User avatar
    Hello Patrick,

    I would like to know why you consider these SQL errors blocking the deployment of the Gerrit integration at Ericsson ? Because If I have understand, these errors don't prevent the process to be finished correctly.

    • Status set to New
    • Platform set to