]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/lc: Do not delete DM if its at end of pagination list. 67573/head
authorkchheda3 <kchheda3@bloomberg.net>
Tue, 14 Oct 2025 20:05:44 +0000 (16:05 -0400)
committerkchheda3 <kchheda3@bloomberg.net>
Fri, 27 Feb 2026 19:02:36 +0000 (19:02 +0000)
fixes tracker https://tracker.ceph.com/issues/73539

Signed-off-by: kchheda3 <kchheda3@bloomberg.net>
(cherry picked from commit dadfa93bfac81d927cbd0fa88dd18b5fca8b796d)

src/rgw/rgw_lc.cc

index 77cb89da3aab5bfa1616e02e1283faf87f5a6ba0..5d92d4eca94aa7bc2fda415ee025d9a69eea3ae6 100644 (file)
@@ -432,10 +432,18 @@ public:
   }
 
   boost::optional<std::string> next_key_name() {
-    if (obj_iter == list_results.objs.end() ||
-       (obj_iter + 1) == list_results.objs.end()) {
-      /* this should have been called after get_obj() was called, so this should
-       * only happen if is_truncated is false */
+    if (obj_iter == list_results.objs.end()) {
+      return boost::none;
+    }
+    if ((obj_iter + 1) == list_results.objs.end()) {
+      /* At the last object in the current page */
+      if (list_results.is_truncated) {
+        /* More pages exist. Cannot determine if next object has same name
+         * without fetching next page. Return current object name to indicate
+         * uncertainty and prevent incorrect DM deletion at page boundaries. */
+        return obj_iter->key.name;
+      }
+      /* No more pages, definitively no next object */
       return boost::none;
     }