Skip to content

coordinator: Fix rewriting additional repos to the wrong storage node

When rewriting repository-scoped messages, we need to rewrite up to two repositories: the target repository that must always be set, and the additional repository that may be set. Naturally, it may happen that these two repositories have different storages. But if it does happen, then we accidentally rewrite both repositories to have the same target storage. In the worst case where a repository with the same relative path exists on the target node, this can cause us to forward the request with a wrongly-resolved storage.

It is questionable whether such a request would make sense in the first place: Praefect cannot guarantee that it knows both storages, and even if it did the target Gitaly node likely wouldn't be able to handle that repository of a potentially unknown storage.

So given that things may go wrong badly right now and that we don't yet have a usecase for resolving to different storages we reject rewriting messages that have repositories with different storages.

Merge request reports