From 87e1934f2d08127cc064279a02b462eabbbdf3ee Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 3 Feb 2023 22:53:46 +0100 Subject: docs(store/protos): update comment on blobstore Read and Put Further emphasize Read() can be used to ask for blobs OR chunks, and that clients usually want to stat and then request (smaller) chunks, rather than reading whole blobs. Also clarify that the chunking used to send BlobChunks over has nothing to do with the chunk sizes communicated in a Stat() request. Change-Id: Ia615d190aae570611de2655b11342a14d0b75976 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8028 Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/store/protos/rpc_blobstore.proto | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'tvix/store/protos/rpc_blobstore.proto') diff --git a/tvix/store/protos/rpc_blobstore.proto b/tvix/store/protos/rpc_blobstore.proto index e0b700f2d0da..c0665e821ae5 100644 --- a/tvix/store/protos/rpc_blobstore.proto +++ b/tvix/store/protos/rpc_blobstore.proto @@ -15,11 +15,27 @@ service BlobService { // contain a single chunk. rpc Stat(StatBlobRequest) returns (BlobMeta); - // Read returns a stream of BlobChunk, which is just a stream of bytes - not necessarily - // using the chunking that's returned in the reply of a Stat() call. + // Read returns a stream of BlobChunk, which is just a stream of bytes with + // the digest specified in ReadBlobRequest. + // + // The server may decide on whatever chunking it may seem fit as a size for + // the individual BlobChunk sent in the response stream. + // + // It specifically is NOT necessarily using chunk sizes communicated in a + // previous Stat request. + // + // It's up to the specific store to decide on whether it allows Read on a + // Blob at all, or only on smaller chunks communicated in a Stat() call + // first. + // + // Clients are enouraged to Stat() first, and then only read the individual + // chunks they don't have yet. rpc Read(ReadBlobRequest) returns (stream BlobChunk); // Put uploads a Blob, by reading a stream of bytes. + // + // The way the data is chunked up in individual BlobChunk messages sent in + // the stream has no effect on how the server ends up chunking blobs up. rpc Put(stream BlobChunk) returns (PutBlobResponse); } @@ -57,7 +73,7 @@ message BlobMeta { } message ReadBlobRequest { - // The blake3 digest of the blob requested + // The blake3 digest of the blob or chunk requested bytes digest = 1; } -- cgit 1.4.1