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:
authorJames Liu <jliu@gitlab.com>2023-12-18 09:49:48 +0300
committerJames Liu <jliu@gitlab.com>2024-01-17 01:13:13 +0300
commite1f6da778cae5991314762474607b5bf3b228a9a (patch)
tree59f643dc13e9a38677f47a906cc505bbf418799f /internal/praefect/server.go
parenta9b8db1b0894b1d613c77b2736409563199d5e62 (diff)
praefect: Intercept WalkRepos RPC
Adds a handler to Praefect to intercept calls to the WalkRepos RPC. The handler provides an alternate implementation of listing repositories in a storage, which queries the Praefect DB rather than walking the filesystem on disk. This is required so when the RPC is invoked via Praefect, the DB is used as the source of truth rather than a random Gitaly node. The only user-facing difference between this and the original implementation is that the `modification_time` attribute of the response message is left empty, as this cannot be determined via the DB.
Diffstat (limited to 'internal/praefect/server.go')
-rw-r--r--internal/praefect/server.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/praefect/server.go b/internal/praefect/server.go
index 54cbee079..c52b160f5 100644
--- a/internal/praefect/server.go
+++ b/internal/praefect/server.go
@@ -195,6 +195,9 @@ func NewGRPCServer(
"DeleteObjectPool": DeleteObjectPoolHandler(deps.RepositoryStore, deps.Logger, deps.Conns),
"GetObjectPool": GetObjectPoolHandler(deps.RepositoryStore, deps.Router),
})
+ proxy.RegisterStreamHandlers(srv, "gitaly.InternalGitaly", map[string]grpc.StreamHandler{
+ "WalkRepos": WalkReposHandler(deps.RepositoryStore),
+ })
}
return srv