]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: clear buckets before calling list_buckets() 43381/head
authorNikhil Kshirsagar <nkshirsagar@gmail.com>
Fri, 1 Oct 2021 04:49:00 +0000 (10:19 +0530)
committerNikhil Kshirsagar <nkshirsagar@gmail.com>
Thu, 14 Oct 2021 17:03:07 +0000 (22:33 +0530)
The ragodgw-admin bucket limit check command has a bug in
octopus. Since we do not clear the bucket list before
list_buckets() returns the next max_entries, they are appended
to the existing list and we end up counting the first ones again.

This bug is triggered if bucket count exceeds max_entries and
causes duplicates in the output of radosgw-admin bucket limit check.

The fix clears the buckets structure before the list_buckets()
populates it again with the next lot of buckets to iterate through.

partial manual cherry-pick of 99f7c4aa1286edfea6961b92bb44bb8fe22bd599

Signed-off-by: Nikhil Kshirsagar <nkshirsagar@gmail.com>
src/rgw/rgw_sal.cc

index 2b7a313ed912076232b23ba00d603517f79ca558..65880a4757ff8c5b06bec0c680c7c15cd9b1c9ec 100644 (file)
@@ -35,6 +35,7 @@ int RGWRadosUser::list_buckets(const string& marker, const string& end_marker,
   RGWUserBuckets ulist;
   bool is_truncated = false;
   int ret;
+  buckets.clear();
 
   ret = store->ctl()->user->list_buckets(info.user_id, marker, end_marker, max,
                                         need_stats, &ulist, &is_truncated);