From: Ilsoo Byun Date: Fri, 11 Oct 2019 02:36:54 +0000 (+0900) Subject: rgw: do not miss the 1000th element of every iteration during lifecycle processing X-Git-Tag: v15.1.0~82^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c9de311ace1f57411af6929679847a45e52053aa;p=ceph.git rgw: do not miss the 1000th element of every iteration during lifecycle processing Signed-off-by: Ilsoo Byun --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index 00abcf3020f8..1e3eb3820219 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -516,25 +516,22 @@ public: bool get_obj(rgw_bucket_dir_entry *obj) { if (obj_iter == objs.end()) { - delay(); - return false; - } - if (is_truncated && (obj_iter + 1)==objs.end()) { - list_op.params.marker = obj_iter->key; - - int ret = fetch(); - if (ret < 0) { - ldout(store->ctx(), 0) << "ERROR: list_op returned ret=" << ret << dendl; - return ret; - } - obj_iter = objs.begin(); - if (obj_iter == objs.end()) { + if (!is_truncated) { + delay(); return false; + } else { + list_op.params.marker = pre_obj.key; + + int ret = fetch(); + if (ret < 0) { + ldout(store->ctx(), 0) << "ERROR: list_op returned ret=" << ret << dendl; + return ret; + } } delay(); } *obj = *obj_iter; - return true; + return obj_iter != objs.end(); } rgw_bucket_dir_entry get_prev_obj() {