Skip to content

Try using go-git for FindCommit

The volume and latency of FindCommit calls is a problem for getting gitlab.com to rely 100% on FindCommit instead of legacy Rugged+NFS commit lookups. We have come up with the following plan to try and squeeze more FindCommit performance out of Gitaly using go-git https://github.com/src-d/go-git.

  • 1. Create a feature flag mechanism

Pass an http/2 header gitaly.feature.foo_bar from gitlab-rails to gitaly. This header will be accessible in gitaly via the request context. This will allow us to experiment safely with go-git in production. Search for gitaly-servers in gitlab-rails and gitaly to see an example of passing http/2 headers.

  • 2. Create a go-git backend for FindCommit

If the feature flag is not set, use normal Git. If the feature flag is set but go-git returns an error, log/count the error and fall back to using normal Git to handle the request.

Edited by Jacob Vosmaer
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information