Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-06 00:08:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-06 00:08:13 +0300
commitd3c29eae5c389e36d4751539fad0462053fb2b20 (patch)
treecc3ae497193f9334d0bc6ee4224637102f6e0d4e /lib/gitlab/gitaly_client.rb
parentad4dbe36445360521fc73a57df13bc8f12eeaa92 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/gitaly_client.rb')
-rw-r--r--lib/gitlab/gitaly_client.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb
index 4eb1ccf32ba..4b5455c0ec9 100644
--- a/lib/gitlab/gitaly_client.rb
+++ b/lib/gitlab/gitaly_client.rb
@@ -141,6 +141,20 @@ module Gitlab
# kwargs.merge(deadline: Time.now + 10)
# end
#
+ # The optional remote_storage keyword argument is used to enable
+ # inter-gitaly calls. Say you have an RPC that needs to pull data from
+ # one repository to another. For example, to fetch a branch from a
+ # (non-deduplicated) fork into the fork parent. In that case you would
+ # send an RPC call to the Gitaly server hosting the fork parent, and in
+ # the request, you would tell that Gitaly server to pull Git data from
+ # the fork. How does that Gitaly server connect to the Gitaly server the
+ # forked repo lives on? This is the problem `remote_storage:` solves: it
+ # adds address and authentication information to the call, as gRPC
+ # metadata (under the `gitaly-servers` header). The request would say
+ # "pull from repo X on gitaly-2". In the Ruby code you pass
+ # `remote_storage: 'gitaly-2'`. And then the metadata would say
+ # "gitaly-2 is at network address tcp://10.0.1.2:8075".
+ #
def self.call(storage, service, rpc, request, remote_storage: nil, timeout: default_timeout, &block)
self.measure_timings(service, rpc, request) do
self.execute(storage, service, rpc, request, remote_storage: remote_storage, timeout: timeout, &block)