•  
      request #3243 More abusive Gerrit cache flushing
    Infos
    #3243
    Patrick Renaud (patrick.renaud)
    2013-05-07 19:11
    2013-05-01 20:46
    2064
    Details
    More abusive Gerrit cache flushing
    When migrating a repo to Gerrit, Tuleap has to perform several steps in sequence. One of these steps is to create new groups if needed and assign members in these groups.

    If a group is composed of several users, Tuleap will flush all caches each time after adding each individual user, one at a time! This has a detrimental effect on the server response time to users when performing these operations.

    Currently the workflow is as follows:

    foreach group
    gerrit ls-groups // Why doing an ls-groups inside a loop?? This won't scale well to thousands of groups.
    foreach username
    gerrit set-account username
    gerrit gsql --format json -c INSERT\ INTO\ account_group_members\ ......
    gerrit flush-caches
    end
    end

    Instead, you should find a way to add all users to a group in a single GSQL call (not sure it's possible, though). Also, Tuleap should flush the proper caches only at the very end of the operation, maybe between each group and at least once at the very end, but certainly not for each user. Imagine the case where a group is composed of hundreds of users!!

    foreach group
    gerrit ls-groups // Can't you move this before the loop and save the results instead?
    foreach username
    gerrit set-account username
    gerrit gsql --format json -c INSERT\ INTO\ account_group_members\ ......
    // Renove this: gerrit flush-caches
    end
    // Move it here: gerrit flush-caches
    end
    // Or move it here: gerrit flush-caches

    Please take into consideration the note I left in the workflow regarding the potentially abusive use of ls-groups inside a loop. I am afraid it will cause performance issues when dealing with thousands of groups, so please consider running it once and save its output instead of running it inside a loop.

    Resolution to this bug is related to bug #3241. Regardless of where the flush-cache instruction is relocated it cannot flush *all* caches this way, ever.
    SCM/Gerrit
    6.0
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    patricia.carrasco@ericsson.com, vladimir.cantiru@ericsson.com, Emilio Palmiero (empa)
    Stage
    Manuel Vacelet (vaceletm)
    Closed
    2013-05-07
    Attachments
    Empty
    References
    References list is empty

    Follow-ups

    User avatar
    • Category changed from SCM/Git to SCM/Gerrit
    • Is an Enhancement or an internal improvement? set to
    User avatar
    This bug is fixed in Tuleap 6
    There is only one ls-group and one flush per migration.

    • 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