Failed request in Praefect should not turn a replication job from pending to ready
Currently, the request finalizer coming from the coordinator will turn a job from pending
to ready
in a defer. This is wrong. If a request fails in praefect, we do not want to trigger replication. We want the job to remain in pending
or even get removed if a request fails.
here is the code that turns a job from pending
to ready
:https://gitlab.com/gitlab-org/gitaly/-/blob/master/internal/praefect/coordinator.go#L210-219
here is the defer that runs that function, regardless of an error in the request or not: https://gitlab.com/gitlab-org/gitaly/-/blob/master/internal/praefect/grpc-proxy/proxy/handler.go#L109