From: J. Eric Ivancich Date: Mon, 14 Sep 2020 23:33:51 +0000 (-0400) Subject: Revert "rgw: fix list bucket with delimiter wrongly skip some special keys" X-Git-Tag: v14.2.12~76^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=130a74a60802d8b0db15dc0d5c9fb6164d78d72d;p=ceph.git Revert "rgw: fix list bucket with delimiter wrongly skip some special keys" 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 --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 537e2386350..bc4749589ab 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -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 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;