Add partitioning hinting to project moves
Rails' a project move API that moves repositories from one Gitaly storage to another. If a repository is connected to a pool, it first replicates the pool to the new storage. It then replicates the repository itself and attempts to connect it to the pool.
Partitioning assignments in Gitaly are implicit at the moment. Each repository goes in to its own partition. Gitaly knows to place a request's target repository and the additional repository in the same partition. As the ReplicateRepository
used by the storage moves doesn't have an additional repository, the pool and the member land in different partitions. This then prevents linking the member to the pool on the new storage.
We should fix this and ensure the member and the pool are assigned into the same partition in this case as well. This could be achieved by supporting partitioning hints. A partitioning hint could be a field in the ReplicateRepositoryRequest
or a header that tells the Gitaly which repository to partition this repository with. Rails could then pass this to Gitaly when replicating the pool member to ensure it lands in the same partition.