diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2021-03-26 11:32:21 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2021-04-01 12:50:52 +0300 |
commit | 9c08dc0188e1a00866c9c1361bfd67862bec01d7 (patch) | |
tree | 409b059fcffbef061ecf7d3414339b39ca8d766a /internal/praefect/server_factory.go | |
parent | 54f0de751b48b23424640cd851a8222b5025f6bc (diff) |
Inject PrimaryGetter and Connection in Praefect's Info server
This commit wires up a PrimaryGetter and Connections into Praefect's
Info server as they'll be needed when converting the methods to support
variable replication factor and repository specific primaries.
ReplicationFactorSetter is also converted into AssignmentStore so the
methods can acccess assignments later.
Diffstat (limited to 'internal/praefect/server_factory.go')
-rw-r--r-- | internal/praefect/server_factory.go | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/internal/praefect/server_factory.go b/internal/praefect/server_factory.go index b8b42cd4f..3bf494556 100644 --- a/internal/praefect/server_factory.go +++ b/internal/praefect/server_factory.go @@ -12,7 +12,6 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/praefect/grpc-proxy/proxy" "gitlab.com/gitlab-org/gitaly/internal/praefect/nodes" "gitlab.com/gitlab-org/gitaly/internal/praefect/protoregistry" - "gitlab.com/gitlab-org/gitaly/internal/praefect/service/info" "gitlab.com/gitlab-org/gitaly/internal/praefect/transactions" "google.golang.org/grpc" "google.golang.org/grpc/credentials" @@ -27,19 +26,23 @@ func NewServerFactory( txMgr *transactions.Manager, queue datastore.ReplicationEventQueue, rs datastore.RepositoryStore, - rfs info.ReplicationFactorSetter, + assignmentStore AssignmentStore, registry *protoregistry.Registry, + conns Connections, + primaryGetter PrimaryGetter, ) *ServerFactory { return &ServerFactory{ - conf: conf, - logger: logger, - director: director, - nodeMgr: nodeMgr, - txMgr: txMgr, - queue: queue, - rs: rs, - rfs: rfs, - registry: registry, + conf: conf, + logger: logger, + director: director, + nodeMgr: nodeMgr, + txMgr: txMgr, + queue: queue, + rs: rs, + assignmentStore: assignmentStore, + registry: registry, + conns: conns, + primaryGetter: primaryGetter, } } @@ -53,9 +56,11 @@ type ServerFactory struct { txMgr *transactions.Manager queue datastore.ReplicationEventQueue rs datastore.RepositoryStore - rfs info.ReplicationFactorSetter + assignmentStore AssignmentStore registry *protoregistry.Registry secure, insecure []*grpc.Server + conns Connections + primaryGetter PrimaryGetter } // Serve starts serving on the provided listener with newly created grpc.Server @@ -124,7 +129,9 @@ func (s *ServerFactory) createGRPC(grpcOpts ...grpc.ServerOption) *grpc.Server { s.txMgr, s.queue, s.rs, - s.rfs, + s.assignmentStore, + s.conns, + s.primaryGetter, grpcOpts..., ) } |