Skip to content

Route repository size Gitaly RPCs to primary

Stan Hu requested to merge sh-route-repository-size-gitaly-primary into master

If you have a Gitaly Cluster with multiple nodes, there's a high possibility that after forking a project the replicas will report differing repository sizes. This depends on when garbage collection has completed on each node As a result, attempting to retrieve any size related data from the repository will vary depending on which Gitaly node is queried.

Since garbage collection isn't transactional, we now force the RepositorySizeRequest and GetObjectDirectorySizeRequest RPCs to go to the primary via the gRPC metadata. This ensures the sizes returned will be consistent from one query to another.

Relates to:

  1. gitaly#3434 (closed)
  2. #255001 (closed)
Edited by Stan Hu

Merge request reports

Loading