aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMostyn Bramley-Moore <mostyn@antipode.se>2022-02-23 18:11:37 +0100
committerGitHub <noreply@github.com>2022-02-23 12:11:37 -0500
commit04784f4a830cc0df1f419a492cde9fc323f728db (patch)
tree19a63b5be3244d2d226fdc01e5e41c981808ae43
parent636121a32fa7b9114311374e4786597d8e7a69f3 (diff)
downloadbazelbuild-remote-apis-04784f4a830cc0df1f419a492cde9fc323f728db.tar.gz
Require that early-return compressed-blobs bytestream uploads set committed_size -1 (#213)
We require that uncompressed bytestream uploads specify committed_size set to the size of the blob when returning early (if the blob already exists on the server). We also require that for compressed bytestream uploads committed_size refers to the initial write offset plus the number of compressed bytes uploaded. But if the server wants to return early in this case it doesn't know how many compressed bytes would have been uploaded (the client might not know this ahead of time either). So let's require that the server set committed_size to -1 in this case. For early return to work, we also need to ensure that the server does not return an error code. Resolves #212.
-rw-r--r--build/bazel/remote/execution/v2/remote_execution.proto9
1 files changed, 5 insertions, 4 deletions
diff --git a/build/bazel/remote/execution/v2/remote_execution.proto b/build/bazel/remote/execution/v2/remote_execution.proto
index dbeff9c..247d774 100644
--- a/build/bazel/remote/execution/v2/remote_execution.proto
+++ b/build/bazel/remote/execution/v2/remote_execution.proto
@@ -255,10 +255,11 @@ service ActionCache {
//
// When attempting an upload, if another client has already completed the upload
// (which may occur in the middle of a single upload if another client uploads
-// the same blob concurrently), the request will terminate immediately with
-// a response whose `committed_size` is the full size of the uploaded file
-// (regardless of how much data was transmitted by the client). If the client
-// completes the upload but the
+// the same blob concurrently), the request will terminate immediately without
+// error, and with a response whose `committed_size` is the value `-1` if this
+// is a compressed upload, or with the full size of the uploaded file if this is
+// an uncompressed upload (regardless of how much data was transmitted by the
+// client). If the client completes the upload but the
// [Digest][build.bazel.remote.execution.v2.Digest] does not match, an
// `INVALID_ARGUMENT` error will be returned. In either case, the client should
// not attempt to retry the upload.