]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: limit rgw_gc_max_objs to RGW_SHARDS_PRIME_1 40670/head
authorRafał Wądołowski <rafal@rafal.net.pl>
Wed, 17 Feb 2021 11:47:07 +0000 (12:47 +0100)
committerNathan Cutler <ncutler@suse.com>
Thu, 8 Apr 2021 12:38:45 +0000 (14:38 +0200)
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 0b99e0870718b31a945fcb13fe61c8d2b57db543..2313acf54327d940bccc5b911fcdc734e6527e01 100644 (file)
@@ -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<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() {