Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Hiltunen <shiltunen@gitlab.com>2021-10-11 15:30:35 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2021-10-14 11:14:32 +0300
commitafc20d772239481c6b55dcd0f9916a602cd50ac1 (patch)
tree767644259acd3a17fddf3ae096ddcedd322ec3ea /internal
parent1b032cf18e9599655f672d5a79f5124976cd8d2a (diff)
Get consistent storages by repository id in PerRepositoryRouter
This commit updates the PerRepositoryRouter's mutator routing to get consistent storages by the repository ID to ensure the query refers to the same repository as the other queries in the method. This avoids races in cases such as the repository being renamed in between the queries.
Diffstat (limited to 'internal')
-rw-r--r--internal/praefect/router_per_repository.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/praefect/router_per_repository.go b/internal/praefect/router_per_repository.go
index 2317029d1..31e8dd059 100644
--- a/internal/praefect/router_per_repository.go
+++ b/internal/praefect/router_per_repository.go
@@ -198,7 +198,7 @@ func (r *PerRepositoryRouter) RouteRepositoryMutator(ctx context.Context, virtua
return RepositoryMutatorRoute{}, nodes.ErrPrimaryNotHealthy
}
- consistentStorages, err := r.csg.GetConsistentStorages(ctx, virtualStorage, relativePath)
+ consistentStorages, err := r.rs.GetConsistentStoragesByRepositoryID(ctx, repositoryID)
if err != nil {
return RepositoryMutatorRoute{}, fmt.Errorf("consistent storages: %w", err)
}