Skip to content

repository: Fix repo replication with transactions (v14.0 backport)

It was reported that repository replication is broken when it's invoked via Praefect with strong consistency. The root cause for this is the same as in commit 0a92b3a0 (repository: Fix voting when cloning from internal pools, 2021-06-14): we do nested mutating RPC calls to the same Gitaly node with the incoming context converted to an outgoing one. As a result, we also forward transaction information to the Gitaly peer. This causes the peer to cast votes on the backchannel, but the backchannel information refers to the Praefect peer and not to the immediate Gitaly peer, and the vote thus fails.

Fix the issue by invoking FetchInternalRemote() directly instead of doing so via a gRPC connection. The backchannel information thus applies to the correct connection and Gitaly can correctly cast its votes.

Edited by Patrick Steinhardt

Merge request reports