diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-08-20 11:23:47 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-08-20 11:23:47 +0300 |
commit | 48d7984d9912c935a2c2abba3b55593cf0be2d8e (patch) | |
tree | a9eea43971ebe80a8f1dbb9329f1c443551ea879 /internal | |
parent | 65f6b0541b63127484bada7a485c7dde20ae2f9a (diff) | |
parent | 1fcf22c1049579a1e9d5d4d1fcccfe1e37889028 (diff) |
Merge branch 'smh-dont-replicate-accept-dataloss' into 'master'
Don't schedule replication jobs in SetAuthoritativeStorage
See merge request gitlab-org/gitaly!3776
Diffstat (limited to 'internal')
-rw-r--r-- | internal/praefect/server.go | 2 | ||||
-rw-r--r-- | internal/praefect/service/info/server.go | 23 |
2 files changed, 1 insertions, 24 deletions
diff --git a/internal/praefect/server.go b/internal/praefect/server.go index 017d6742f..4eb4b1c4c 100644 --- a/internal/praefect/server.go +++ b/internal/praefect/server.go @@ -154,7 +154,7 @@ func registerServices( ) { // ServerServiceServer is necessary for the ServerInfo RPC gitalypb.RegisterServerServiceServer(srv, server.NewServer(conf, conns)) - gitalypb.RegisterPraefectInfoServiceServer(srv, info.NewServer(conf, queue, rs, assignmentStore, conns, primaryGetter)) + gitalypb.RegisterPraefectInfoServiceServer(srv, info.NewServer(conf, rs, assignmentStore, conns, primaryGetter)) gitalypb.RegisterRefTransactionServer(srv, transaction.NewServer(tm)) healthpb.RegisterHealthServer(srv, health.NewServer()) diff --git a/internal/praefect/service/info/server.go b/internal/praefect/service/info/server.go index 3e32d9135..8ab27ab55 100644 --- a/internal/praefect/service/info/server.go +++ b/internal/praefect/service/info/server.go @@ -37,7 +37,6 @@ type PrimaryGetter interface { type Server struct { gitalypb.UnimplementedPraefectInfoServiceServer conf config.Config - queue datastore.ReplicationEventQueue rs datastore.RepositoryStore assignmentStore AssignmentStore conns service.Connections @@ -47,7 +46,6 @@ type Server struct { // NewServer creates a new instance of a grpc InfoServiceServer func NewServer( conf config.Config, - queue datastore.ReplicationEventQueue, rs datastore.RepositoryStore, assignmentStore AssignmentStore, conns service.Connections, @@ -55,7 +53,6 @@ func NewServer( ) gitalypb.PraefectInfoServiceServer { return &Server{ conf: conf, - queue: queue, rs: rs, assignmentStore: assignmentStore, conns: conns, @@ -89,25 +86,5 @@ func (s *Server) SetAuthoritativeStorage(ctx context.Context, req *gitalypb.SetA return nil, helper.ErrInternal(err) } - // Schedule replication jobs to other physical storages to get them consistent with the - // new authoritative repository. - for _, storage := range storages { - if storage == req.AuthoritativeStorage { - continue - } - - if _, err := s.queue.Enqueue(ctx, datastore.ReplicationEvent{ - Job: datastore.ReplicationJob{ - Change: datastore.UpdateRepo, - VirtualStorage: req.VirtualStorage, - RelativePath: req.RelativePath, - SourceNodeStorage: req.AuthoritativeStorage, - TargetNodeStorage: storage, - }, - }); err != nil { - return nil, helper.ErrInternal(err) - } - } - return &gitalypb.SetAuthoritativeStorageResponse{}, nil } |