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:
authorJohn Cai <jcai@gitlab.com>2021-12-08 19:47:34 +0300
committerJohn Cai <jcai@gitlab.com>2021-12-13 18:01:12 +0300
commit84eaa31e0940f439068cd3960713c9c800b851d8 (patch)
tree9145d3212c71b56793899ac87532b8c76c69d3b2 /internal
parentfef2131b1d0628a2ce2d245871920af44be24ec3 (diff)
cmd/praefect: replicate immediately after track-repository
track-repository is a subcommand that tracks a repository in the praefect database. This is generally used by an admin when a repository is on disk but not tracked in the praefect db. Once tracked, replication to the other nodes takes about 5 minutes and requires the Praefect process to be running. This MR adds a flag that, if set, will immediately process a relication job and wait for it to finish. Changelog: added
Diffstat (limited to 'internal')
-rw-r--r--internal/praefect/replicator.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/praefect/replicator.go b/internal/praefect/replicator.go
index a9cf2de6c..64a02bb08 100644
--- a/internal/praefect/replicator.go
+++ b/internal/praefect/replicator.go
@@ -780,6 +780,11 @@ func (r ReplMgr) backfillReplicaPath(ctx context.Context, event datastore.Replic
}
}
+// ProcessReplicationEvent processes a single replication event given the target client connection
+func (r ReplMgr) ProcessReplicationEvent(ctx context.Context, event datastore.ReplicationEvent, targetCC *grpc.ClientConn) error {
+ return r.processReplicationEvent(ctx, event, targetCC)
+}
+
func (r ReplMgr) processReplicationEvent(ctx context.Context, event datastore.ReplicationEvent, targetCC *grpc.ClientConn) error {
var cancel func()