Praefect: Replication Manager
Replication between backend nodes need to be managed, so the praefect needs a replication manager. In the first iteration this manager doesn't have a persistent data store yet so state is managed in memory. This means that on start up the praefect needs to load the required data by calling RPCs. I think the checksum RPC and the FetchInternalRemote RPCs are mostly what we need to manage replica's.
First we need replication logic: #1484 (closed), although these issues could be solved with one MR.
To note;
Our config file allows for more than one backend node, so it's conceivable that this map can contain more than one
grpc.ClientConn
. If we use a map to iterate over it and break on the first element, the backend node will get chosen in-deterministically since map iteration occurs randomly. Is that going to cause issues?
While this statement is true now, only the first registered Gitaly gets served. This should also be solved.
/cc @pokstad1