Skip to content

Allow differing relative paths in ReplicateRepository (15.4)

Sami Hiltunen requested to merge smh-backport-rr-15-4 into 15-4-stable

ReplicateRepository checks that the relative paths of the source and the target repositories are the same. This is more of a sanity check than a requirement. With Prafect rewriting relative paths, this check fails and causes ReplicateRepository to fail with Praefect in front. Previously the tests were not running with Praefect enabled which allowed for this regression to slip through. This commit removes the check which allows the RPC to work with Praefect enabled. The target repository has a rewritten relative path as it's where the Gitaly will store the replicated repository. The source repository's path is not rewritten by Praefect as Gitaly fetches it by going through the source storage. If the source storage is hosted by a Praefect, the relative path would be rewritten at that point by Praefect.

8de608e9 is cherry-picked as well as the tests will fail without it since ReplicateRepository did not work in Praefect with an existing repository before it. It's nice to include it anyway here as it does away with another recurring problem in ReplicateRepositroy and migrating repositories across shards.

Additionally, this change differs from !5082 (merged) and !5081 (merged) by changing the parameter order of (*testing.T, context.Context) in GetReplicaPath. They were previously in different order so we've adapted the last commit here.

Backport of !5076 (merged)

Edited by Sami Hiltunen

Merge request reports