Skip to content

Add partition hint to project move api

What does this MR do and why?

For gitaly#5764 (closed)

Rails has 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 into its own partition. Gitaly knows to place a request's target repository and the additional repository in the same partition. As the ReplicateRepository RPC used by the project move API doesn't have an additional repository field, the pool and the member land in different partitions. This then prevents linking the member to the pool on the new storage.

Add a partitioning hint to the ReplicateRepository RPC call which is set to the object pool's disk path. The hint is treated in a similar manner to the additional repository field, and ensures Gitaly moves the repo to the same partition as the pool.

Rearrange the order of operations so the object pool is replicated first, followed by its member repositories. This is required because Gitaly expects the hinted repository to exist.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by James Liu

Merge request reports