]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: do not miss the 1000th element of every iteration during lifecycle processing 30861/head
authorIlsoo Byun <ilsoobyun@linecorp.com>
Fri, 11 Oct 2019 02:36:54 +0000 (11:36 +0900)
committerIlsoo Byun <ilsoobyun@linecorp.com>
Tue, 15 Oct 2019 01:29:48 +0000 (10:29 +0900)
Signed-off-by: Ilsoo Byun <ilsoobyun@linecorp.com>
src/rgw/rgw_lc.cc

index 00abcf3020f8adea3b13077a1690cb6519fce1bf..1e3eb3820219b3e9e3f2f15c9041446b792da51f 100644 (file)
@@ -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() {