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:
Diffstat (limited to 'cmd/praefect/main.go')
-rw-r--r--cmd/praefect/main.go33
1 files changed, 2 insertions, 31 deletions
diff --git a/cmd/praefect/main.go b/cmd/praefect/main.go
index 65328d49e..ed908551c 100644
--- a/cmd/praefect/main.go
+++ b/cmd/praefect/main.go
@@ -84,7 +84,6 @@ import (
"gitlab.com/gitlab-org/gitaly/v14/internal/praefect/nodes/tracker"
"gitlab.com/gitlab-org/gitaly/v14/internal/praefect/protoregistry"
"gitlab.com/gitlab-org/gitaly/v14/internal/praefect/reconciler"
- "gitlab.com/gitlab-org/gitaly/v14/internal/praefect/repocleaner"
"gitlab.com/gitlab-org/gitaly/v14/internal/praefect/service/transaction"
"gitlab.com/gitlab-org/gitaly/v14/internal/praefect/transactions"
"gitlab.com/gitlab-org/gitaly/v14/internal/version"
@@ -301,10 +300,6 @@ func run(cfgs []starter.Config, conf config.Config) error {
}()
healthChecker = hm
- // Wait for the first health check to complete so the Praefect doesn't start serving RPC
- // before the router is ready with the health status of the nodes.
- <-hm.Updated()
-
elector := nodes.NewPerRepositoryElector(db)
primaryGetter = elector
@@ -356,7 +351,7 @@ func run(cfgs []starter.Config, conf config.Config) error {
repl = praefect.NewReplMgr(
logger,
- conf.StorageNames(),
+ conf.VirtualStorageNames(),
queue,
rs,
healthChecker,
@@ -364,7 +359,6 @@ func run(cfgs []starter.Config, conf config.Config) error {
praefect.WithDelayMetric(delayMetric),
praefect.WithLatencyMetric(latencyMetric),
praefect.WithDequeueBatchSize(conf.Replication.BatchSize),
- praefect.WithParallelStorageProcessingWorkers(conf.Replication.ParallelStorageProcessingWorkers),
)
srvFactory = praefect.NewServerFactory(
conf,
@@ -427,7 +421,7 @@ func run(cfgs []starter.Config, conf config.Config) error {
return fmt.Errorf("unable to start the bootstrap: %v", err)
}
- go repl.ProcessBacklog(ctx, praefect.ExpBackoffFactory{Start: time.Second, Max: 5 * time.Second})
+ go repl.ProcessBacklog(ctx, praefect.ExpBackoffFunc(1*time.Second, 5*time.Second))
logger.Info("background started: processing of the replication events")
repl.ProcessStale(ctx, 30*time.Second, time.Minute)
logger.Info("background started: processing of the stale replication events")
@@ -448,29 +442,6 @@ func run(cfgs []starter.Config, conf config.Config) error {
}
}
- if interval := conf.RepositoriesCleanup.RunInterval.Duration(); interval > 0 {
- if db != nil {
- go func() {
- storageSync := datastore.NewStorageCleanup(db)
- cfg := repocleaner.Cfg{
- RunInterval: conf.RepositoriesCleanup.RunInterval.Duration(),
- LivenessInterval: 30 * time.Second,
- RepositoriesInBatch: conf.RepositoriesCleanup.RepositoriesInBatch,
- }
- repoCleaner := repocleaner.NewRunner(cfg, logger, healthChecker, nodeSet.Connections(), storageSync, storageSync, repocleaner.NewLogWarnAction(logger))
- if err := repoCleaner.Run(ctx, helper.NewTimerTicker(conf.RepositoriesCleanup.CheckInterval.Duration())); err != nil && !errors.Is(context.Canceled, err) {
- logger.WithError(err).Error("repository cleaner finished execution")
- } else {
- logger.Info("repository cleaner finished execution")
- }
- }()
- } else {
- logger.Warn("Repository cleanup background task disabled as there is no database connection configured.")
- }
- } else {
- logger.Warn(`Repository cleanup background task disabled as "repositories_cleanup.run_interval" is not set or 0.`)
- }
-
return b.Wait(conf.GracefulStopTimeout.Duration())
}