How to handle proxying FindRemoteRepository
With the goal of praefect as a pass through proxy that routes requests based on repository, FindRemoteRepository
is an odd one. It does not require a repository and so is not repository-scoped. Praefect either needs a repository scoped RPC so it knows how to forward it, or it handles the RPC itself eg: ServerInfo
, DiskUsage
.
we need a way to handle FindRemoteRepository
and we have a couple of options.
- Write a handler in Praefect that can intercept this RPC, and pick a random gitaly node to forward it to.
- Change the rails code so that it does this call in rails and doesn't even hit praefect/gitaly. (call
popen
to a git process)
I like option 2, because its the most simple solution and we don't have to add another 1-off in praefect.