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
path: root/ruby
diff options
context:
space:
mode:
authorSami Hiltunen <shiltunen@gitlab.com>2021-11-20 17:39:50 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2021-11-30 16:29:00 +0300
commit13ba757fdcb5200e59954fb0200e44b4b95c9629 (patch)
tree8d389825ac16ab184bd33dec44360d1848525053 /ruby
parent83e0b3f00a9cdf5cbba52aeb8b33535460557f7a (diff)
Add RPC definitions for GetRepositoryMetadata
Praefect has methods in the datastore to retrieve a repository's metadata. This commit adds RPC definitions that allow for retrieving the metadata from cluster. This RPC endpoint is going to be used by a command line tool to retrieve a repository's metadata and by Gitaly tests that run with Praefect in front and peek in to the filesystem. Changelog: added
Diffstat (limited to 'ruby')
-rw-r--r--ruby/proto/gitaly/praefect_pb.rb30
-rw-r--r--ruby/proto/gitaly/praefect_services_pb.rb2
2 files changed, 32 insertions, 0 deletions
diff --git a/ruby/proto/gitaly/praefect_pb.rb b/ruby/proto/gitaly/praefect_pb.rb
index d2784c57f..34610d9fd 100644
--- a/ruby/proto/gitaly/praefect_pb.rb
+++ b/ruby/proto/gitaly/praefect_pb.rb
@@ -7,6 +7,32 @@ require 'lint_pb'
require 'shared_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("praefect.proto", :syntax => :proto3) do
+ add_message "gitaly.GetRepositoryMetadataRequest" do
+ oneof :query do
+ optional :repository_id, :int64, 1
+ optional :path, :message, 2, "gitaly.GetRepositoryMetadataRequest.Path"
+ end
+ end
+ add_message "gitaly.GetRepositoryMetadataRequest.Path" do
+ optional :virtual_storage, :string, 1
+ optional :relative_path, :string, 2
+ end
+ add_message "gitaly.GetRepositoryMetadataResponse" do
+ optional :repository_id, :int64, 1
+ optional :virtual_storage, :string, 2
+ optional :relative_path, :string, 3
+ optional :replica_path, :string, 4
+ optional :primary, :string, 5
+ optional :generation, :int64, 6
+ repeated :replicas, :message, 7, "gitaly.GetRepositoryMetadataResponse.Replica"
+ end
+ add_message "gitaly.GetRepositoryMetadataResponse.Replica" do
+ optional :storage, :string, 1
+ optional :assigned, :bool, 2
+ optional :generation, :int64, 4
+ optional :healthy, :bool, 5
+ optional :valid_primary, :bool, 6
+ end
add_message "gitaly.SetReplicationFactorRequest" do
optional :virtual_storage, :string, 1
optional :relative_path, :string, 2
@@ -57,6 +83,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
end
module Gitaly
+ GetRepositoryMetadataRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.GetRepositoryMetadataRequest").msgclass
+ GetRepositoryMetadataRequest::Path = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.GetRepositoryMetadataRequest.Path").msgclass
+ GetRepositoryMetadataResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.GetRepositoryMetadataResponse").msgclass
+ GetRepositoryMetadataResponse::Replica = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.GetRepositoryMetadataResponse.Replica").msgclass
SetReplicationFactorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.SetReplicationFactorRequest").msgclass
SetReplicationFactorResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.SetReplicationFactorResponse").msgclass
SetAuthoritativeStorageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.SetAuthoritativeStorageRequest").msgclass
diff --git a/ruby/proto/gitaly/praefect_services_pb.rb b/ruby/proto/gitaly/praefect_services_pb.rb
index c1045f01f..dcb72810f 100644
--- a/ruby/proto/gitaly/praefect_services_pb.rb
+++ b/ruby/proto/gitaly/praefect_services_pb.rb
@@ -30,6 +30,8 @@ module Gitaly
# from a Praefect node that does not yet know about a new node. As assignments of unconfigured storages are ignored, replication
# factor of repositories assigned to a storage node removed from the cluster is effectively decreased.
rpc :SetReplicationFactor, Gitaly::SetReplicationFactorRequest, Gitaly::SetReplicationFactorResponse
+ # GetRepositoryMetadata returns the cluster metadata for a repository. Returns NotFound if the repository does not exist.
+ rpc :GetRepositoryMetadata, Gitaly::GetRepositoryMetadataRequest, Gitaly::GetRepositoryMetadataResponse
end
Stub = Service.rpc_stub_class