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.
This commit is contained in:
Rob Meng
2023-11-07 12:33:32 -05:00
committed by GitHub
parent d43ef7f11e
commit 80613a40fd

View File

@@ -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
}