]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "rgw: fix list bucket with delimiter wrongly skip some special keys"
authorJ. Eric Ivancich <ivancich@redhat.com>
Mon, 14 Sep 2020 23:33:51 +0000 (19:33 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Tue, 15 Sep 2020 20:20:06 +0000 (16:20 -0400)
This reverts commit 04b15cef88c5d50ce18911f63c63fa094101ced0.

While this did fix https://tracker.ceph.com/issues/40905, it did so in
an unnecessarily complex manner. So we're reverting it to more easily
apply a cleaner solution.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
src/rgw/rgw_rados.cc

index 537e2386350a332a382be83a2e00429f2b37458e..bc4749589ab1d70ae67410a1784a98e0862b611f 100644 (file)
@@ -2467,6 +2467,15 @@ int RGWRados::Bucket::List::list_objects_ordered(
     }
     prev_marker = cur_marker;
 
+    if (skip_after_delim > cur_marker.name) {
+      cur_marker = skip_after_delim;
+
+      ldout(cct, 20) << "setting cur_marker="
+                    << cur_marker.name
+                    << "[" << cur_marker.instance << "]"
+                    << dendl;
+    }
+
     std::map<string, rgw_bucket_dir_entry> ent_map;
     int r = store->cls_bucket_list_ordered(target->get_bucket_info(),
                                           shard_id,
@@ -2551,6 +2560,14 @@ int RGWRados::Bucket::List::list_objects_ordered(
             next_marker = prefix_key;
             (*common_prefixes)[prefix_key] = true;
 
+            int marker_delim_pos = cur_marker.name.find(
+             params.delim, cur_prefix.size());
+
+            skip_after_delim = cur_marker.name.substr(0, marker_delim_pos);
+            skip_after_delim.append(after_delim_s);
+
+            ldout(cct, 20) << "skip_after_delim=" << skip_after_delim << dendl;
+
             count++;
           }
 
@@ -2570,24 +2587,6 @@ int RGWRados::Bucket::List::list_objects_ordered(
       count++;
     } // eiter for loop
 
-    if (!params.delim.empty()) {
-      int marker_delim_pos = cur_marker.name.find(params.delim, cur_prefix.size());
-      if (marker_delim_pos >= 0) {
-        skip_after_delim = cur_marker.name.substr(0, marker_delim_pos);
-        skip_after_delim.append(after_delim_s);
-
-        ldout(cct, 20) << "skip_after_delim=" << skip_after_delim << dendl;
-
-        if (skip_after_delim > cur_marker.name) {
-          cur_marker = skip_after_delim;
-          ldout(cct, 20) << "setting cur_marker="
-                         << cur_marker.name
-                         << "[" << cur_marker.instance << "]"
-                         << dendl;
-        }
-      }
-    }
-
     ldout(cct, 20) << "RGWRados::Bucket::List::" << __func__ <<
       " INFO end of outer loop, truncated=" << truncated <<
       ", count=" << count << ", attempt=" << attempt << dendl;