From ad420d55743bf6ec42669bb5445a88500543e0e1 Mon Sep 17 00:00:00 2001 From: Orit Wasserman Date: Sun, 11 Jun 2017 16:04:52 +0300 Subject: [PATCH] rgw: check all users bucket for resharding, this will reshard bucket created in older versions Signed-off-by: Orit Wasserman --- src/rgw/rgw_rados.cc | 3 +++ src/rgw/rgw_user.cc | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 721fc30f5a2c0..2002abfbc2fde 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -13120,6 +13120,9 @@ int RGWRados::check_bucket_shards(const RGWBucketInfo& bucket_info, const rgw_bu } if (need_resharding) { + ldout(cct, 20) << __func__ << " bucket " << bucket.name << " need resharding " << + " old num shards " << bucket_info.num_shards << " new num shards " << suggested_num_shards << + dendl; return add_bucket_to_reshard(bucket_info, suggested_num_shards); } diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index 2a2f3dd386abf..a73ff047f5838 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -77,6 +77,11 @@ int rgw_user_sync_all_stats(RGWRados *store, const rgw_user& user_id) ldout(cct, 0) << "ERROR: could not sync bucket stats: ret=" << ret << dendl; return ret; } + RGWQuotaInfo bucket_quota; + ret = store->check_bucket_shards(bucket_info, bucket_info.bucket, bucket_quota); + if (ret < 0) { + ldout(cct, 0) << "ERROR in check_bucket_shards: " << cpp_strerror(-ret)<< dendl; + } } } while (is_truncated); -- 2.39.5