From 3c160731ed82484d2aaec29ba2364153a7cbe9c8 Mon Sep 17 00:00:00 2001 From: Yureka Date: Fri, 19 Jul 2024 12:35:09 +0200 Subject: fix(tvix/castore/blob/object_store): empty chunk list for single chunk Change-Id: Ie3609ac6184ecead11c4e03073433c26ce129848 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11981 Autosubmit: yuka Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/castore/src/blobservice/object_store.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tvix') diff --git a/tvix/castore/src/blobservice/object_store.rs b/tvix/castore/src/blobservice/object_store.rs index 224ebae9e2c6..846f3643761d 100644 --- a/tvix/castore/src/blobservice/object_store.rs +++ b/tvix/castore/src/blobservice/object_store.rs @@ -349,6 +349,15 @@ async fn chunk_and_upload( .collect::>>() .await?; + let chunks = if chunks.len() < 2 { + // The chunker returned only one chunk, which is the entire blob. + // According to the protocol, we must return an empty list of chunks + // when the blob is not split up further. + vec![] + } else { + chunks + }; + let stat_blob_response = StatBlobResponse { chunks, bao: "".into(), // still todo -- cgit 1.4.1