]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: bucket limit check misbehaves for > max-entries buckets (usually 1000) 26945/head
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 6 Mar 2019 22:05:11 +0000 (17:05 -0500)
committerAshish Singh <assingh@redhat.com>
Thu, 14 Mar 2019 07:31:52 +0000 (13:01 +0530)
RGWBucketAdminOp::limit_check does not correctly handle
truncation/continuation markers across calls to rgw_read_user_buckets(...).
Also, it should, but does not, flush its formatter periodically.

Fixes: https://tracker.ceph.com/issues/35973
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 675b775ea52e0d7b81efb32c6cffa6987190184b)

src/rgw/rgw_bucket.cc

index e688388e43236e6af7d12c1e3b5e349b5c06c8f8..45859827124ceea091302b4db0625108f1686c2c 100644 (file)
@@ -1474,14 +1474,15 @@ int RGWBucketAdminOp::limit_check(RGWRados *store,
   formatter->open_array_section("users");
 
   for (const auto& user_id : user_ids) {
+
     formatter->open_object_section("user");
     formatter->dump_string("user_id", user_id);
-    bool done;
     formatter->open_array_section("buckets");
+
+    string marker;
+    bool is_truncated{false};
     do {
       RGWUserBuckets buckets;
-      string marker;
-      bool is_truncated;
 
       ret = rgw_read_user_buckets(store, user_id, buckets,
                                  marker, string(), max_entries, false,
@@ -1556,9 +1557,8 @@ int RGWBucketAdminOp::limit_check(RGWRados *store,
          }
        }
       }
-
-      done = (m_buckets.size() < max_entries);
-    } while (!done); /* foreach: bucket */
+      formatter->flush(cout);
+    } while (is_truncated); /* foreach: bucket */
 
     formatter->close_section();
     formatter->close_section();