Skip to content
  • Stan Hu's avatar
    Fix slow fetches for repositories using object deduplication · 30dae0a0
    Stan Hu authored
    This mirrors the change in Omnibus:
    https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/3559
    
    In https://gitlab.com/gitlab-org/gitaly/merge_requests/1297, we
    introduced a mechanism to prevent accidental deletion of objects from
    object pools. The idea is that if an object becomes "dangling", meaning
    there is no ref pointing to it, we just add a new ref to un-dangle
    it. It turns out this can create too many refs.
    
    If a pooled repository may contain many dangling references, a fetch
    from the parent repository to one of its forks may take an
    extraordinarily long time because git will attempt to run `git
    for-each-ref` on every single ref in the pooled repository. This can
    cause a simple fetch to take minutes.
    
    To avoid this problem, we use a similar strategy that we employed in the
    `git push` case
    (https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests/3364).  We
    disable the fetching of refs from the alternates via the
    `core.alternateRefsCommand` config option.
    30dae0a0