•  
      request #3241 Abusive Gerrit cache flushing
    Infos
    #3241
    Patrick Renaud (patrick.renaud)
    2013-05-09 17:51
    2013-05-01 19:40
    2062
    Details
    Abusive Gerrit cache flushing
    As part of the Gerrit integration, Tuleap must flush a few Gerrit caches after manipulating the database when updating the members of a group. This is a consequence of having to alter database entries to work around the absence of a proper CLI that would otherwise take care of properly doing this operation cleanly.

    Currently, based on what I observed, Tuleap flushes *all* chaches after doing its database manipulation. While this guarantees that the database change is made visible to the Gerrit runtime environment, it has a dramatic impact on the performance of our master server. As stipulated in the Gerrit documentation for flush-caches --all:

    “This is like applying a big hammer, it will force everything out, potentially more than was necessary for the change made.”

    In our case, this results in repopulating the ldap_groups_byinclude cache which can take a significant amount of time, making Gerrit non-responsive during that time.

    It is imperative to not flush all caches on the running system unless under an emergency situation. In the case of adding/removing users from a group it would be sufficient to issue a command to flush only the “groups” cache and the “groups_byinclude” cache only. So I would ask you to please change your code so that the following command is executed for flushing caches after a group membership update:

    gerrit flush-caches --cache groups --cache groups_byinclude

    Please check to confirm if it is sufficient to flush only these two caches or if additional caches need to be considered too.

    PS. This is a showstopper for deploying the Gerrit integration at Ericsson.
    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
    Referenced by request #3241

    Follow-ups

    User avatar
    Tests using Tuleap 6 indicate that the only cache being flushed now is "accounts", which is OK.

    I noticed that you don't flush any cache at all when creating a new group populated with the users taken from an existing Tuleap group. This surprised me as I would have expected the same cache flush at the end of the operation. However it seems to work nevertheless and Gerrit sees the proper group membership upon conclusion of the operation. I need to investigate this a bit deeper as I don't understand how Gerrit knows about a change made directly to its db without reloading the appropriate cache...

    • Is an Enhancement or an internal improvement? set to
    User avatar
    This bug is fixed in tuleap 6

    • Status changed from New to Declined
    • 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
    Interestingly, the proposed patch seems to be flushing "accounts" and "groups_byinclude". You are not flushing "groups" anymore although it is specified in the bug report.

    Was I wrong in saying that "groups" and "group_byinclude" needed to be flushed?