about summary refs log tree commit diff
path: root/tvix/store/protos/rpc_blobstore.proto
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2022-12-27T17·32+0100
committerflokli <flokli@flokli.de>2022-12-28T13·55+0000
commit1c15154b834fd529b95b3026c867e34ad98787f0 (patch)
tree853953bed52de4ccdee218af1bbbc5a0a8140d93 /tvix/store/protos/rpc_blobstore.proto
parentf879993cc49e2dacb8286767fb92e34078f0c8e4 (diff)
feat(tvix/store): make blobstore stream chunks r/5527
This changes the RPC methods to return/consume a stream of chunks, instead of a
very big message containing the whole blob, to keep message sizes in manageable
sizes (less than 4MiB).

Change-Id: I2a3a50f07b059d8a2f5196860254adff98c8a352
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7651
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/protos/rpc_blobstore.proto')
-rw-r--r--tvix/store/protos/rpc_blobstore.proto19
1 files changed, 9 insertions, 10 deletions
diff --git a/tvix/store/protos/rpc_blobstore.proto b/tvix/store/protos/rpc_blobstore.proto
index 1d4349bc6bb6..cca195c3d975 100644
--- a/tvix/store/protos/rpc_blobstore.proto
+++ b/tvix/store/protos/rpc_blobstore.proto
@@ -7,8 +7,9 @@ package tvix.store.v1;
 option go_package = "code.tvl.fyi/tvix/store/protos;storev1";
 
 service BlobService {
-    rpc Get(GetBlobRequest) returns (GetBlobResponse);
-    rpc Put(PutBlobRequest) returns (PutBlobResponse);
+    rpc Get(GetBlobRequest) returns (stream BlobChunk);
+
+    rpc Put(stream BlobChunk) returns (PutBlobResponse);
 
     // TODO(flokli): We can get fancy here, and add methods to retrieve
     // [Bao](https://github.com/oconnor663/bao/blob/master/docs/spec.md), and
@@ -20,15 +21,13 @@ message GetBlobRequest {
     bytes digest = 1;
 }
 
-message GetBlobResponse {
-    bytes data = 1;
-}
-
-message PutBlobRequest {
-    bytes data = 1;
-}
-
 message PutBlobResponse {
     // The blake3 digest of the data that was sent.
     bytes digest = 1;
 }
+
+// This represents a part of a chunk.
+// Blobs are sent in smaller chunks to keep message sizes manageable.
+message BlobChunk {
+    bytes data = 1;
+}