From: Rafał Wądołowski Date: Wed, 17 Feb 2021 11:47:07 +0000 (+0100) Subject: rgw: limit rgw_gc_max_objs to RGW_SHARDS_PRIME_1 X-Git-Tag: v14.2.22~22^2~11^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=bdccbe659857fdf4a7383cf81fe3cb67d3d3b4a8;p=ceph.git rgw: limit rgw_gc_max_objs to RGW_SHARDS_PRIME_1 Don't allow GC to process more gc ojects than RGW_SHARDS_PRIME_1 Fixes: https://tracker.ceph.com/issues/49321 Signed-off-by: Rafał Wądołowski (cherry picked from commit 7b163048d93a078e2354665488a27225042d3f1a) --- diff --git a/src/rgw/rgw_gc.cc b/src/rgw/rgw_gc.cc index 0b99e0870718b..2313acf54327d 100644 --- a/src/rgw/rgw_gc.cc +++ b/src/rgw/rgw_gc.cc @@ -161,11 +161,11 @@ class RGWGCIOManager { public: RGWGCIOManager(const DoutPrefixProvider* _dpp, CephContext *_cct, RGWGC *_gc) : dpp(_dpp), - cct(_cct), - gc(_gc), - remove_tags(cct->_conf->rgw_gc_max_objs), - tag_io_size(cct->_conf->rgw_gc_max_objs) { + cct(_cct), + gc(_gc) { max_aio = cct->_conf->rgw_gc_max_concurrent_io; + remove_tags.resize(min(static_cast(cct->_conf->rgw_gc_max_objs), rgw_shards_max())); + tag_io_size.resize(min(static_cast(cct->_conf->rgw_gc_max_objs), rgw_shards_max())); } ~RGWGCIOManager() {