• Stan Hu's avatar
    Allow ref name caching CommitService#find_commit · db759c5d
    Stan Hu authored
    For a given merge request, it's quite common to see duplicate FindCommit
    Gitaly requests because the Gitaly CommitService caches the request by
    the commit SHA, not by the ref name. However, most of the duplicate
    requests use the ref name, so the cache is never actually used in
    practice. This leads to unnecessary requests that slow performance.
    
    This commit allows certain callers to bypass the ref name to
    OID conversion in the cache. We don't do this by default because it's
    possible the tip of the branch changes during the commit, which
    would cause the caller to get stale data.
    
    This commit also forces the Ci::Pipeline to use the full ref name
    so that caching can work for merge requests.
    
    Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57083
    db759c5d
merge_requests_controller_spec.rb 32 KB