]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/gc: mark rgw_gc_max_objs as startup-only 68478/head
authorMatthew N. Heler <matthew.heler@hotmail.com>
Mon, 20 Apr 2026 17:35:41 +0000 (12:35 -0500)
committerMatthew N. Heler <matthew.heler@hotmail.com>
Mon, 20 Apr 2026 17:50:23 +0000 (12:50 -0500)
Raising rgw_gc_max_objs at runtime crashes the GC thread.

Reject runtime changes and size the IOManager vectors from the
stored max_objs.

Signed-off-by: Matthew N. Heler <matthew.heler@hotmail.com>
src/common/options/rgw.yaml.in
src/rgw/driver/rados/rgw_gc.cc
src/rgw/driver/rados/rgw_gc.h

index 57000c5154b53618b4ddd61a8a75e90d3fa7e87c..8ce36045c70289c29d6b2bf2ef22ea731f0b4b2c 100644 (file)
@@ -1861,10 +1861,13 @@ options:
   level: advanced
   desc: Number of shards for garbage collector data
   long_desc: The number of garbage collector data shards, is the number of RADOS objects
-    that RGW will use to store the garbage collection information on.
+    that RGW will use to store the garbage collection information on. This value is
+    read once at daemon startup.
   fmt_desc: The maximum number of objects that may be handled by
     garbage collection in one garbage collection processing cycle.
-    Please do not change this value after the first deployment.
+    This value can be increased after first deployment, please do
+    not decrease this value without ensuring all data shards are
+    completely empty.
   default: 32
   services:
   - rgw
@@ -1873,6 +1876,8 @@ options:
   - rgw_gc_processor_max_time
   - rgw_gc_processor_period
   - rgw_gc_max_concurrent_io
+  flags:
+  - startup
   with_legacy: true
 # wait time before object may be handled by gc, recommended lower limit is 30 mins
 - name: rgw_gc_obj_min_wait
index 8a9e464f1dd584ce302b75c75a5216c3ed61dde2..a1ef3a69db69274016d716085b47de995b08bb18 100644 (file)
@@ -384,8 +384,9 @@ public:
                                                                                   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()));
+    // must match obj_names[] / transitioned_objects_cache sized in initialize()
+    remove_tags.resize(gc->get_max_objs());
+    tag_io_size.resize(gc->get_max_objs());
   }
 
   ~RGWGCIOManager() {
index b7a118204271f46d01985c1906c98b71c8b8a115..7523130a3985654e859d1d9e34c306133fdfd2e6 100644 (file)
@@ -50,6 +50,7 @@ public:
     finalize();
   }
   std::vector<bool> transitioned_objects_cache;
+  int get_max_objs() const { return max_objs; }
   std::tuple<int, std::optional<cls_rgw_obj_chain>> send_split_chain(const cls_rgw_obj_chain& chain, const std::string& tag, optional_yield y);
 
   // asynchronously defer garbage collection on an object that's still being read