]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: limit rgw_gc_max_objs to RGW_SHARDS_PRIME_1 40255/head
authorRafał Wądołowski <rafal@rafal.net.pl>
Wed, 17 Feb 2021 11:47:07 +0000 (12:47 +0100)
committersinguliere <singuliere@autistici.org>
Fri, 19 Mar 2021 18:20:46 +0000 (19:20 +0100)
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 <rwadolowski@cloudferro.com>
(cherry picked from commit 7b163048d93a078e2354665488a27225042d3f1a)

src/rgw/rgw_gc.cc

index 322871f84ec29951fef44255de7e6869e02a5b9b..5e3070d3fcc1c9397da3ad27ae1646bbe786418f 100644 (file)
@@ -313,11 +313,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<int>(cct->_conf->rgw_gc_max_objs), rgw_shards_max()));
+    tag_io_size.resize(min(static_cast<int>(cct->_conf->rgw_gc_max_objs), rgw_shards_max()));
   }
 
   ~RGWGCIOManager() {