diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/praefect/main.go | 5 | ||||
-rw-r--r-- | cmd/praefect/subcmd_accept_dataloss_test.go | 2 | ||||
-rw-r--r-- | cmd/praefect/subcmd_dataloss_test.go | 2 | ||||
-rw-r--r-- | cmd/praefect/subcmd_set_replication_factor_test.go | 2 |
4 files changed, 8 insertions, 3 deletions
diff --git a/cmd/praefect/main.go b/cmd/praefect/main.go index 0e229b8fb..4daafd172 100644 --- a/cmd/praefect/main.go +++ b/cmd/praefect/main.go @@ -304,6 +304,7 @@ func run(cfgs []starter.Config, conf config.Config) error { healthChecker praefect.HealthChecker nodeSet praefect.NodeSet router praefect.Router + primaryGetter praefect.PrimaryGetter ) if conf.Failover.ElectionStrategy == config.ElectionStrategyPerRepository { nodeSet, err = praefect.DialNodes(ctx, conf.VirtualStorages, protoregistry.GitalyProtoPreregistered, errTracker) @@ -327,6 +328,7 @@ func run(cfgs []starter.Config, conf config.Config) error { } }() + primaryGetter = elector assignmentStore = datastore.NewAssignmentStore(db, conf.StorageNames()) router = praefect.NewPerRepositoryRouter( @@ -342,6 +344,7 @@ func run(cfgs []starter.Config, conf config.Config) error { healthChecker = praefect.HealthChecker(nodeManager) nodeSet = praefect.NodeSetFromNodeManager(nodeManager) router = praefect.NewNodeManagerRouter(nodeManager, rs) + primaryGetter = nodeManager nodeManager.Start(conf.Failover.BootstrapInterval.Duration(), conf.Failover.MonitorInterval.Duration()) } @@ -383,6 +386,8 @@ func run(cfgs []starter.Config, conf config.Config) error { rs, assignmentStore, protoregistry.GitalyProtoPreregistered, + nodeSet.Connections(), + primaryGetter, ) ) metricsCollectors = append(metricsCollectors, transactionManager, coordinator, repl) diff --git a/cmd/praefect/subcmd_accept_dataloss_test.go b/cmd/praefect/subcmd_accept_dataloss_test.go index 7927df9dc..3c3ae6259 100644 --- a/cmd/praefect/subcmd_accept_dataloss_test.go +++ b/cmd/praefect/subcmd_accept_dataloss_test.go @@ -61,7 +61,7 @@ func TestAcceptDatalossSubcommand(t *testing.T) { }, } - ln, clean := listenAndServe(t, []svcRegistrar{registerPraefectInfoServer(info.NewServer(nil, conf, q, rs, nil))}) + ln, clean := listenAndServe(t, []svcRegistrar{registerPraefectInfoServer(info.NewServer(nil, conf, q, rs, nil, nil, nil))}) defer clean() conf.SocketPath = ln.Addr().String() diff --git a/cmd/praefect/subcmd_dataloss_test.go b/cmd/praefect/subcmd_dataloss_test.go index 14ae43a57..3c67783d5 100644 --- a/cmd/praefect/subcmd_dataloss_test.go +++ b/cmd/praefect/subcmd_dataloss_test.go @@ -109,7 +109,7 @@ func TestDatalossSubcommand(t *testing.T) { require.NoError(t, gs.SetGeneration(ctx, "virtual-storage-1", "repository-2", "gitaly-3", 0)) ln, clean := listenAndServe(t, []svcRegistrar{ - registerPraefectInfoServer(info.NewServer(nil, cfg, nil, gs, nil))}) + registerPraefectInfoServer(info.NewServer(nil, cfg, nil, gs, nil, nil, nil))}) defer clean() for _, tc := range []struct { desc string diff --git a/cmd/praefect/subcmd_set_replication_factor_test.go b/cmd/praefect/subcmd_set_replication_factor_test.go index 090da41ee..e830450e5 100644 --- a/cmd/praefect/subcmd_set_replication_factor_test.go +++ b/cmd/praefect/subcmd_set_replication_factor_test.go @@ -93,7 +93,7 @@ func TestSetReplicationFactorSubcommand(t *testing.T) { ) ln, clean := listenAndServe(t, []svcRegistrar{registerPraefectInfoServer( - info.NewServer(nil, config.Config{}, nil, nil, store), + info.NewServer(nil, config.Config{}, nil, nil, store, nil, nil), )}) defer clean() |