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:
authorJames Fargher <jfargher@gitlab.com>2021-10-04 03:49:59 +0300
committerJames Fargher <jfargher@gitlab.com>2021-10-04 21:37:17 +0300
commit60fc2c957cc22cb61497344ceca5b9b46851e28e (patch)
tree87b4ae92fa0119e2c1fa3c7a2c716a7a61cd1b84 /ruby
parent40e3e5e971f2043c947b1bc347090c6c0e7d63df (diff)
Determine when CreateBundleFromRefList would generate an empty bundle
In order to gracefully handle incremental backups where nothing has changed, we need to determine when `git bundle create` failed because the bundle was empty. This isn't an error for incremental backups, it simply means there were no updates. The FailedPrecondition GRPC code was chosen here since it best matches the litmus test: > (c) Use FailedPrecondition if the client should not retry until > the system state has been explicitly fixed. E.g., if an "rmdir" > fails because the directory is non-empty, FailedPrecondition > should be returned since the client should not retry unless > they have first fixed up the directory by deleting files from it. Changelog: changed
Diffstat (limited to 'ruby')
-rw-r--r--ruby/proto/gitaly/repository-service_services_pb.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/ruby/proto/gitaly/repository-service_services_pb.rb b/ruby/proto/gitaly/repository-service_services_pb.rb
index 68de3267c..f7451e2fe 100644
--- a/ruby/proto/gitaly/repository-service_services_pb.rb
+++ b/ruby/proto/gitaly/repository-service_services_pb.rb
@@ -38,7 +38,8 @@ module Gitaly
rpc :CreateRepositoryFromURL, Gitaly::CreateRepositoryFromURLRequest, Gitaly::CreateRepositoryFromURLResponse
# CreateBundle creates a bundle from all refs
rpc :CreateBundle, Gitaly::CreateBundleRequest, stream(Gitaly::CreateBundleResponse)
- # CreateBundleFromRefList creates a bundle from a stream of ref patterns
+ # CreateBundleFromRefList creates a bundle from a stream of ref patterns.
+ # When the bundle would be empty the FailedPrecondition error code is returned.
rpc :CreateBundleFromRefList, stream(Gitaly::CreateBundleFromRefListRequest), stream(Gitaly::CreateBundleFromRefListResponse)
# FetchBundle fetches references from a bundle into the local repository.
# Refs will be mirrored to the target repository with the refspec