From: Matthew N. Heler Date: Mon, 20 Apr 2026 17:35:41 +0000 (-0500) Subject: rgw/gc: mark rgw_gc_max_objs as startup-only X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c3e57712272ea6c060ef323f0a86b88eb50f4119;p=ceph.git rgw/gc: mark rgw_gc_max_objs as startup-only 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 --- diff --git a/src/common/options/rgw.yaml.in b/src/common/options/rgw.yaml.in index 57000c5154b5..8ce36045c702 100644 --- a/src/common/options/rgw.yaml.in +++ b/src/common/options/rgw.yaml.in @@ -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 diff --git a/src/rgw/driver/rados/rgw_gc.cc b/src/rgw/driver/rados/rgw_gc.cc index 8a9e464f1dd5..a1ef3a69db69 100644 --- a/src/rgw/driver/rados/rgw_gc.cc +++ b/src/rgw/driver/rados/rgw_gc.cc @@ -384,8 +384,9 @@ public: 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())); + // 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() { diff --git a/src/rgw/driver/rados/rgw_gc.h b/src/rgw/driver/rados/rgw_gc.h index b7a118204271..7523130a3985 100644 --- a/src/rgw/driver/rados/rgw_gc.h +++ b/src/rgw/driver/rados/rgw_gc.h @@ -50,6 +50,7 @@ public: finalize(); } std::vector transitioned_objects_cache; + int get_max_objs() const { return max_objs; } std::tuple> 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