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-03-30 15:56:33 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2021-04-13 10:33:11 +0300
commit4238815b1e9fd69ee699ee827385b3e851afbdea (patch)
tree74dd2537b0706f1736d6ba05dc9911ff08006cfa /cmd/gitaly-hooks
parent0290f2d5dfde26e30836feb2ffc824a3077e5f05 (diff)
Enable reference transaction voting via backchannels
This commit implements backchannel voting support in Gitaly behind the 'gitaly_backchannel_voting' feature flag. Historically, Gitaly has used Praefect provided details to dial back to the Praefect to cast votes. This has been problematic due to the address provided by Praefect not always being reachable by Gitaly. To solve the dialing problems, connection multiplexing was implemented between Gitaly and Praefect to allow Gitaly to communicate withe the TransactionService in Praefect via the same connection Praefect established to Gitaly. When the feature flags is enabled, Gitaly uses the 'backchannel' connection instead of connecting to the Praefect using the Praefect provided details.
Diffstat (limited to 'cmd/gitaly-hooks')
-rw-r--r--cmd/gitaly-hooks/hooks_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/gitaly-hooks/hooks_test.go b/cmd/gitaly-hooks/hooks_test.go
index 5e93a7b49..da3040ac0 100644
--- a/cmd/gitaly-hooks/hooks_test.go
+++ b/cmd/gitaly-hooks/hooks_test.go
@@ -584,10 +584,11 @@ func runHookServiceServer(t *testing.T, cfg config.Cfg) func() {
}
func runHookServiceServerWithAPI(t *testing.T, cfg config.Cfg, gitlabAPI gitalyhook.GitlabAPI) func() {
- txManager := transaction.NewManager(cfg, backchannel.NewRegistry())
+ registry := backchannel.NewRegistry()
+ txManager := transaction.NewManager(cfg, registry)
hookManager := gitalyhook.NewManager(config.NewLocator(cfg), txManager, gitlabAPI, cfg)
gitCmdFactory := git.NewExecCommandFactory(cfg)
- server := testhelper.NewServerWithAuth(t, nil, nil, cfg.Auth.Token, testhelper.WithInternalSocket(cfg))
+ server := testhelper.NewServerWithAuth(t, nil, nil, cfg.Auth.Token, registry, testhelper.WithInternalSocket(cfg))
gitalypb.RegisterHookServiceServer(server.GrpcServer(), hook.NewServer(cfg, hookManager, gitCmdFactory))
reflection.Register(server.GrpcServer())