From 80613a40fddca10e8ed9b39cf765a9f84f445096 Mon Sep 17 00:00:00 2001 From: Rob Meng Date: Tue, 7 Nov 2023 12:33:32 -0500 Subject: [PATCH] skip missing file on mirrored dir when deleting (#635) mirrored store is not garueeteed to have all the files. Ignore the ones that doesn't exist. --- rust/vectordb/src/io/object_store.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rust/vectordb/src/io/object_store.rs b/rust/vectordb/src/io/object_store.rs index 1d0fbdc6..9643091a 100644 --- a/rust/vectordb/src/io/object_store.rs +++ b/rust/vectordb/src/io/object_store.rs @@ -25,7 +25,8 @@ use bytes::Bytes; use futures::{stream::BoxStream, FutureExt, StreamExt}; use lance::io::object_store::WrappingObjectStore; use object_store::{ - path::Path, GetOptions, GetResult, ListResult, MultipartId, ObjectMeta, ObjectStore, Result, + path::Path, Error, GetOptions, GetResult, ListResult, MultipartId, ObjectMeta, ObjectStore, + Result, }; use async_trait::async_trait; @@ -120,7 +121,10 @@ impl ObjectStore for MirroringObjectStore { async fn delete(&self, location: &Path) -> Result<()> { if !location.primary_only() { - self.secondary.delete(location).await?; + match self.secondary.delete(location).await { + Err(Error::NotFound { .. }) | Ok(_) => {} + Err(e) => return Err(e), + } } self.primary.delete(location).await }