From 9b74f684507cd57e9ec5b286a6ccf1c853c6bc02 Mon Sep 17 00:00:00 2001 From: Cherilyn Buren <88433283+NiuBlibing@users.noreply.github.com> Date: Mon, 8 Apr 2024 17:19:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(object=5Fstore):=20Continue=20operation=20i?= =?UTF-8?q?n=20delete=5Fobjects=20function=20when=E2=80=A6=20(#15704)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/object_store/src/object/s3.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/object_store/src/object/s3.rs b/src/object_store/src/object/s3.rs index 43a118dd829af..3c270f5c1780d 100644 --- a/src/object_store/src/object/s3.rs +++ b/src/object_store/src/object/s3.rs @@ -490,6 +490,7 @@ impl ObjectStore for S3ObjectStore { async fn delete_objects(&self, paths: &[String]) -> ObjectResult<()> { // AWS restricts the number of objects per request to 1000. const MAX_LEN: usize = 1000; + let mut all_errors = Vec::new(); // If needed, split given set into subsets of size with no more than `MAX_LEN` objects. for start_idx /* inclusive */ in (0..paths.len()).step_by(MAX_LEN) { @@ -512,9 +513,15 @@ impl ObjectStore for S3ObjectStore { // Check if there were errors. if !delete_output.errors().is_empty() { - return Err(ObjectError::internal(format!("DeleteObjects request returned exception for some objects: {:?}", delete_output.errors()))); + all_errors.append(&mut delete_output.errors().to_owned()); } } + if !all_errors.is_empty() { + return Err(ObjectError::internal(format!( + "DeleteObjects request returned exception for some objects: {:?}", + all_errors + ))); + } Ok(()) }