about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-04-14T12·54+0300
committerclbot <clbot@tvl.fyi>2024-04-15T14·47+0000
commitfb852b0245aab7637ffca2b7583be2e282cfe063 (patch)
tree7790c9c998684caa7c58f887e9351b8e8494dfbd
parentf1349caf3f6128e53880ef7829258de27c0a4481 (diff)
fix(tvix/castore/blobs): reply to has() for chunks r/7930
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 <flokli@flokli.de>
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
-rw-r--r--tvix/castore/src/blobservice/object_store.rs9
1 files changed, 8 insertions, 1 deletions
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)?,
         }
     }