This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new ccd1421cba3 branch-4.0: [fix](client) Handle empty S3 list page with 
more results in concurrent deletion scenario #60332 (#60710)
ccd1421cba3 is described below

commit ccd1421cba3eadffe5884464c02edd5f40307b78
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Feb 14 10:57:08 2026 +0800

    branch-4.0: [fix](client) Handle empty S3 list page with more results in 
concurrent deletion scenario #60332 (#60710)
    
    Cherry-picked from #60332
    
    Co-authored-by: Yixuan Wang <[email protected]>
---
 cloud/src/recycler/s3_obj_client.cpp   | 17 +++++++++++++++--
 cloud/test/s3_accessor_client_test.cpp | 13 ++-----------
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/cloud/src/recycler/s3_obj_client.cpp 
b/cloud/src/recycler/s3_obj_client.cpp
index d0bb503e36c..fb51f9b3e8d 100644
--- a/cloud/src/recycler/s3_obj_client.cpp
+++ b/cloud/src/recycler/s3_obj_client.cpp
@@ -140,8 +140,21 @@ public:
                 
const_cast<std::string&&>(outcome.GetResult().GetNextContinuationToken())));
 
         auto&& content = outcome.GetResult().GetContents();
-        DCHECK(!(has_more_ && content.empty()))
-                << has_more_ << ' ' << content.empty() << " request_id=" << 
request_id;
+        // clang-format off
+        DCHECK(!(has_more_ && req_.GetContinuationToken().empty()))
+                << "has_more=" << has_more_
+                << " token=" << req_.GetContinuationToken()
+                << " request_id=" << request_id;
+        // clang-format on
+        if (has_more_ && req_.GetContinuationToken().empty()) {
+            LOG(ERROR) << "it is impossible to have more results but no 
continuation token";
+            has_more_ = false;
+        }
+        if (has_more_ && content.empty()) {
+            LOG(INFO) << "Empty page with more results (possible concurrent 
deletion), continuing"
+                      << " request_id=" << request_id;
+            return has_next();
+        }
 
         results_.reserve(content.size());
         for (auto&& obj : std::ranges::reverse_view(content)) {
diff --git a/cloud/test/s3_accessor_client_test.cpp 
b/cloud/test/s3_accessor_client_test.cpp
index d83f54e82ea..9805ae2b488 100644
--- a/cloud/test/s3_accessor_client_test.cpp
+++ b/cloud/test/s3_accessor_client_test.cpp
@@ -144,10 +144,9 @@ protected:
                          << ret;
         }
 
-        std::string test_path = "s3_accessor_test_dir";
         // Clean up test directory if it exists
         if (s3_accessor) {
-            s3_accessor->delete_directory("/");
+            s3_accessor->delete_all();
         }
     }
 
@@ -184,18 +183,10 @@ protected:
     void TearDown() override {
         // Cleanup test directory
         if (s3_accessor) {
-            s3_accessor->delete_directory("/");
+            s3_accessor->delete_all();
         }
     }
 
-    std::string get_unique_test_path() {
-        std::string path = config_->get_prefix();
-        if (!path.empty() && path.back() != '/') {
-            path += '/';
-        }
-        return path;
-    }
-
     std::shared_ptr<S3TestConfig> config_;
     std::shared_ptr<StorageVaultAccessor> s3_accessor;
 };


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to