diff options
Diffstat (limited to 'cmd/praefect/main.go')
-rw-r--r-- | cmd/praefect/main.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd/praefect/main.go b/cmd/praefect/main.go index 37fdddb22..acf53d2fa 100644 --- a/cmd/praefect/main.go +++ b/cmd/praefect/main.go @@ -16,6 +16,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/sirupsen/logrus" + "gitlab.com/gitlab-org/gitaly/internal/praefect" "gitlab.com/gitlab-org/gitaly/internal/praefect/config" "gitlab.com/gitlab-org/gitaly/internal/version" @@ -113,8 +114,6 @@ func run(listeners []net.Listener, conf config.Config) error { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - go func() { serverErrors <- repl.ProcessBacklog(ctx) }() - allBackendServers := append(conf.SecondaryServers, conf.PrimaryServer) for _, gitaly := range allBackendServers { @@ -122,9 +121,13 @@ func run(listeners []net.Listener, conf config.Config) error { return fmt.Errorf("failed to register %s: %s", gitaly.Name, err) } - logger.WithField("gitaly listen addr", gitaly.ListenAddr).Info("registered gitaly node") + logger.WithField("node_name", gitaly.Name).WithField("gitaly listen addr", gitaly.ListenAddr).Info("registered gitaly node") } + go func() { serverErrors <- repl.ProcessBacklog(ctx) }() + + go coordinator.FailoverRotation() + select { case s := <-termCh: logger.WithField("signal", s).Warn("received signal, shutting down gracefully") |