]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/rgw/rgw_orphan.cc
import ceph 15.2.14
[ceph.git] / ceph / src / rgw / rgw_orphan.cc
index d6ad28ff0e9439b1bd803fbafe95a4bb4c73c9a7..eb769d76c2fa809411234aae9125c85a292a207b 100644 (file)
@@ -1493,7 +1493,7 @@ int RGWRadosList::do_incomplete_multipart(
                               &is_listing_truncated, null_yield);
     if (ret == -ENOENT) {
       // could bucket have been removed while this is running?
-      ldout(store->ctx(), 20) << "RGWRadosList::" << __func__ <<
+      ldout(store->ctx(), 5) << "RGWRadosList::" << __func__ <<
        ": WARNING: call to list_objects of multipart namespace got ENOENT; "
        "assuming bucket removal race" << dendl;
       break;
@@ -1520,22 +1520,27 @@ int RGWRadosList::do_incomplete_multipart(
       }
 
       // now process the uploads vector
-      int parts_marker = 0;
-      bool is_parts_truncated = false;
-      do {
-       map<uint32_t, RGWUploadPartInfo> parts;
+      for (const auto& upload : uploads) {
+       const RGWMPObj& mp = upload.mp;
+       int parts_marker = 0;
+       bool is_parts_truncated = false;
 
-       for (const auto& upload : uploads) {
-         const RGWMPObj& mp = upload.mp;
+       do { // while (is_parts_truncated);
+         std::map<uint32_t, RGWUploadPartInfo> parts;
          ret = list_multipart_parts(store, bucket_info, store->ctx(),
                                     mp.get_upload_id(), mp.get_meta(),
-                                    max_parts,
-                                    parts_marker, parts, NULL, &is_parts_truncated);
+                                    max_parts, parts_marker,
+                                    parts, &parts_marker,
+                                    &is_parts_truncated);
          if (ret == -ENOENT) {
-           continue;
+           ldout(store->ctx(), 5) <<  "RGWRadosList::" << __func__ <<
+             ": WARNING: list_multipart_parts returned ret=-ENOENT "
+             "for " << mp.get_upload_id() << ", moving on" << dendl;
+           break;
          } else if (ret < 0) {
            lderr(store->ctx()) << "RGWRadosList::" << __func__ <<
-             ": ERROR: list_multipart_parts returned ret=" << ret << dendl;
+             ": ERROR: list_multipart_parts returned ret=" << ret <<
+             dendl;
            return ret;
          }
 
@@ -1547,10 +1552,10 @@ int RGWRadosList::do_incomplete_multipart(
              const rgw_raw_obj& loc =
                obj_it.get_location().get_raw_obj(store->getRados());
              std::cout << loc.oid << std::endl;
-           }
-         }
-       }
-      } while (is_parts_truncated);
+           } // for (auto obj_it
+         } // for (auto& p
+       } while (is_parts_truncated);
+      } // for (const auto& upload
     } // if objs not empty
   } while (is_listing_truncated);