From 11ab7c8234daa3d4c077710ea4c8b0437e57daf8 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Thu, 4 Jun 2020 12:41:06 -0400 Subject: [PATCH] rgw: bucket list/stats truncates for user w/ >1000 buckets 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 --- src/rgw/rgw_bucket.cc | 4 ++-- src/rgw/rgw_sal.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index d94d22a3ef0..ed04c867cdc 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -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()) { diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 356cbefebb6..542844d0392 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -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: -- 2.47.3