From 9518bd6bff3d3e41880829445890680b84902ba7 Mon Sep 17 00:00:00 2001 From: Gabriel BenHanokh Date: Sun, 5 Oct 2025 08:29:53 +0000 Subject: [PATCH] rgw/dedup: Grant dedup process full RGW permissions. This is necessary to allow for the creation of intermediate SLAB objects on systems configured with Ceph authentication. Adds a minor change logging detailed info when failing to parse etag Remove bogus assert Signed-off-by: Gabriel BenHanokh --- src/rgw/driver/rados/rgw_dedup.cc | 17 +++++++++-------- src/rgw/driver/rados/rgw_dedup_utils.cc | 12 +++++++++--- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/rgw/driver/rados/rgw_dedup.cc b/src/rgw/driver/rados/rgw_dedup.cc index 7c00ddf6f2a..cf2075c1a75 100644 --- a/src/rgw/driver/rados/rgw_dedup.cc +++ b/src/rgw/driver/rados/rgw_dedup.cc @@ -344,7 +344,7 @@ namespace rgw::dedup { return ret; } - ret = ioctx.application_enable("rgw_dedup", false); + ret = ioctx.application_enable("rgw", false); if (ret == 0) { ldpp_dout(dpp, 10) << __func__ << "::pool " << dedup_pool.name << " was associated with dedup app" << dendl; @@ -1499,16 +1499,11 @@ namespace rgw::dedup { const rgw_bucket_dir_entry &entry, worker_stats_t *p_worker_stats /*IN-OUT*/) { - // ceph store full blocks so need to round up and multiply by block_size - uint64_t ondisk_byte_size = calc_on_disk_byte_size(entry.meta.size); - // count all objects including too small and non default storage_class objs - p_worker_stats->ingress_obj++; - p_worker_stats->ingress_obj_bytes += ondisk_byte_size; - parsed_etag_t parsed_etag; if (unlikely(!parse_etag_string(entry.meta.etag, &parsed_etag))) { p_worker_stats->ingress_corrupted_etag++; - ldpp_dout(dpp, 1) << __func__ << "::ERROR: corrupted etag" << dendl; + ldpp_dout(dpp, 1) << __func__ << "::ERROR: corrupted etag:" << entry.meta.etag + << "::" << p_bucket->get_name() << "/" << entry.key.name << dendl; return -EINVAL; } @@ -1516,6 +1511,12 @@ namespace rgw::dedup { show_ingress_bucket_idx_obj(dpp, parsed_etag, p_bucket->get_name(), entry.key.name); } + // ceph store full blocks so need to round up and multiply by block_size + uint64_t ondisk_byte_size = calc_on_disk_byte_size(entry.meta.size); + // count all objects including too small and non default storage_class objs + p_worker_stats->ingress_obj++; + p_worker_stats->ingress_obj_bytes += ondisk_byte_size; + // We limit dedup to objects from the same storage_class // TBD: // Should we use a skip-list of storage_classes we should skip (like glacier) ? diff --git a/src/rgw/driver/rados/rgw_dedup_utils.cc b/src/rgw/driver/rados/rgw_dedup_utils.cc index baadee5aeef..cbedcb0c7f5 100644 --- a/src/rgw/driver/rados/rgw_dedup_utils.cc +++ b/src/rgw/driver/rados/rgw_dedup_utils.cc @@ -309,9 +309,15 @@ namespace rgw::dedup { f->dump_unsigned("non default storage class objs bytes", this->non_default_storage_class_objs_bytes); } - else { - ceph_assert(this->default_storage_class_objs == this->ingress_obj); - ceph_assert(this->default_storage_class_objs_bytes == this->ingress_obj_bytes); + else { + if (this->default_storage_class_objs != this->ingress_obj) { + f->dump_unsigned("Bad default storage class objs (should be identical to ingress_obj)", + this->default_storage_class_objs); + } + if (this->default_storage_class_objs_bytes != this->ingress_obj_bytes) { + f->dump_unsigned("Bad default storage class objs bytes (should be identical to ingress_obj_bytes)", + this->default_storage_class_objs_bytes); + } } } -- 2.39.5