Route repository size Gitaly RPCs to primary
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:
Edited by Stan Hu