From fb852b0245aab7637ffca2b7583be2e282cfe063 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 14 Apr 2024 15:54:32 +0300 Subject: fix(tvix/castore/blobs): reply to has() for chunks We allow reading individual chunks via open_read(), it's inconsistent if a has() would return Ok(false). Change-Id: Ie713d968172ccd2687d2e6e0dfef89ee152ef511 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11420 Autosubmit: flokli Reviewed-by: Connor Brewster Tested-by: BuildkiteCI --- tvix/castore/src/blobservice/object_store.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tvix/castore/src') diff --git a/tvix/castore/src/blobservice/object_store.rs b/tvix/castore/src/blobservice/object_store.rs index 106c3d5169aa..c2e54e15df79 100644 --- a/tvix/castore/src/blobservice/object_store.rs +++ b/tvix/castore/src/blobservice/object_store.rs @@ -125,7 +125,14 @@ impl BlobService for ObjectStoreBlobService { match self.object_store.head(&p).await { Ok(_) => Ok(true), - Err(object_store::Error::NotFound { .. }) => Ok(false), + Err(object_store::Error::NotFound { .. }) => { + let p = derive_chunk_path(&self.base_path, digest); + match self.object_store.head(&p).await { + Ok(_) => Ok(true), + Err(object_store::Error::NotFound { .. }) => Ok(false), + Err(e) => Err(e)?, + } + } Err(e) => Err(e)?, } } -- cgit 1.4.1