]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: limit rgw_gc_max_objs to RGW_SHARDS_PRIME_1 39515/head
authorRafał Wądołowski <rafal@rafal.net.pl>
Wed, 17 Feb 2021 11:47:07 +0000 (12:47 +0100)
committerRafał Wądołowski <rafal@rafal.net.pl>
Fri, 19 Feb 2021 06:17:47 +0000 (07:17 +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>
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() {