diff options
author | James Fargher <jfargher@gitlab.com> | 2021-10-04 03:49:59 +0300 |
---|---|---|
committer | James Fargher <jfargher@gitlab.com> | 2021-10-04 21:37:17 +0300 |
commit | 60fc2c957cc22cb61497344ceca5b9b46851e28e (patch) | |
tree | 87b4ae92fa0119e2c1fa3c7a2c716a7a61cd1b84 /proto | |
parent | 40e3e5e971f2043c947b1bc347090c6c0e7d63df (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 'proto')
-rw-r--r-- | proto/go/gitalypb/repository-service_grpc.pb.go | 6 | ||||
-rw-r--r-- | proto/repository-service.proto | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/proto/go/gitalypb/repository-service_grpc.pb.go b/proto/go/gitalypb/repository-service_grpc.pb.go index 6f434d4d1..50da376fa 100644 --- a/proto/go/gitalypb/repository-service_grpc.pb.go +++ b/proto/go/gitalypb/repository-service_grpc.pb.go @@ -42,7 +42,8 @@ type RepositoryServiceClient interface { CreateRepositoryFromURL(ctx context.Context, in *CreateRepositoryFromURLRequest, opts ...grpc.CallOption) (*CreateRepositoryFromURLResponse, error) // CreateBundle creates a bundle from all refs CreateBundle(ctx context.Context, in *CreateBundleRequest, opts ...grpc.CallOption) (RepositoryService_CreateBundleClient, error) - // 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. CreateBundleFromRefList(ctx context.Context, opts ...grpc.CallOption) (RepositoryService_CreateBundleFromRefListClient, error) // FetchBundle fetches references from a bundle into the local repository. // Refs will be mirrored to the target repository with the refspec @@ -798,7 +799,8 @@ type RepositoryServiceServer interface { CreateRepositoryFromURL(context.Context, *CreateRepositoryFromURLRequest) (*CreateRepositoryFromURLResponse, error) // CreateBundle creates a bundle from all refs CreateBundle(*CreateBundleRequest, RepositoryService_CreateBundleServer) error - // 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. CreateBundleFromRefList(RepositoryService_CreateBundleFromRefListServer) error // FetchBundle fetches references from a bundle into the local repository. // Refs will be mirrored to the target repository with the refspec diff --git a/proto/repository-service.proto b/proto/repository-service.proto index 33ac2ebf0..61416421f 100644 --- a/proto/repository-service.proto +++ b/proto/repository-service.proto @@ -113,7 +113,8 @@ service RepositoryService { }; } - // 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 CreateBundleFromRefListRequest) returns (stream CreateBundleFromRefListResponse) { option (op_type) = { op: ACCESSOR |