Skip to content

Commit

Permalink
Require that early-return compressed-blobs bytestream uploads set com…
Browse files Browse the repository at this point in the history
…mitted_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.
  • Loading branch information
mostynb committed Feb 23, 2022
1 parent 636121a commit 04784f4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions build/bazel/remote/execution/v2/remote_execution.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 04784f4

Please sign in to comment.