]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: bucket list/stats truncates for user w/ >1000 buckets
authorJ. Eric Ivancich <ivancich@redhat.com>
Thu, 4 Jun 2020 16:41:06 +0000 (12:41 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Sat, 6 Jun 2020 18:57:14 +0000 (14:57 -0400)
The is_truncated flag was not being handled properly and therefore
limited the output on these radosgw-admin commands to 1000 buckets.

Fixes: https://tracker.ceph.com/issues/45630
Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
src/rgw/rgw_bucket.cc
src/rgw/rgw_sal.h

index d94d22a3ef0df3b6fcc3b35e4d46797ec59cadb2..ed04c867cdc6eed610467e42815934fa22b73069 100644 (file)
@@ -1604,9 +1604,9 @@ int RGWBucketAdminOp::info(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState
     rgw::sal::RGWBucketList buckets;
     rgw::sal::RGWRadosUser user(store, op_state.get_user_id());
     string marker;
-    bool is_truncated = false;
 
     do {
+      buckets.clear();
       ret = user.list_buckets(marker, string(), max_entries, false, buckets);
       if (ret < 0)
         return ret;
@@ -1629,7 +1629,7 @@ int RGWBucketAdminOp::info(rgw::sal::RGWRadosStore *store, RGWBucketAdminOpState
       }
 
       flusher.flush();
-    } while (is_truncated);
+    } while (buckets.is_truncated());
 
     formatter->close_section();
   } else if (!bucket_name.empty()) {
index 356cbefebb6e56b88c4d6437a08dfbf4798cc0f6..542844d03924868770b2629e11559fafe7c25378 100644 (file)
@@ -154,8 +154,8 @@ public:
     buckets[bucket->ent.bucket.name] = bucket;
   }
   size_t count() const { return buckets.size(); }
-
-};
+  void clear() { buckets.clear(); truncated = false; }
+}; // class RGWBucketList
 
 class RGWObject {
   protected: