From: Pritha Srivastava Date: Wed, 18 Mar 2026 11:15:03 +0000 (+0530) Subject: rgw/d4n: adding a unique version to every "null" X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3fc84af76ecf2e821cdb3a0f8aebc8f7ea61940f;p=ceph.git rgw/d4n: adding a unique version to every "null" delete marker, but letting the instance be null. Signed-off-by: Pritha Srivastava --- diff --git a/src/rgw/driver/d4n/d4n_policy.cc b/src/rgw/driver/d4n/d4n_policy.cc index 5c9b8f5e4a3e..ff3c917bebd2 100644 --- a/src/rgw/driver/d4n/d4n_policy.cc +++ b/src/rgw/driver/d4n/d4n_policy.cc @@ -722,17 +722,14 @@ void LFUDAPolicy::cleaning(const DoutPrefixProvider* dpp) ldpp_dout(dpp, 10) << __func__ << "(): e->key=" << e->key << dendl; int op_ret; if (e->delete_marker) { - bool null_delete_marker = (c_obj->get_instance() == "null"); - if (null_delete_marker) { - //clear the instance for backend store - c_obj->clear_instance(); - } std::unique_ptr del_op = c_obj->get_delete_op(); del_op->params.obj_owner = owner; del_op->params.bucket_owner = c_bucket->get_owner(); del_op->params.versioning_status = c_bucket->get_info().versioning_status(); //populate marker_version_id only when delete marker is not null - del_op->params.marker_version_id = e->version; + if (!null_instance) { + del_op->params.marker_version_id = e->version; + } op_ret = del_op->delete_obj(dpp, null_yield, rgw::sal::FLAG_LOG_OP); if (op_ret >= 0) { bool delete_marker = del_op->result.delete_marker; @@ -744,10 +741,6 @@ void LFUDAPolicy::cleaning(const DoutPrefixProvider* dpp) erase_dirty_object(dpp, e->key, null_yield); continue; } - if (null_delete_marker) { - //restore instance for directory data processing in later steps - c_obj->set_instance("null"); - } } else { //end-if delete_marker std::unique_ptr processor = driver->get_atomic_writer(dpp, diff --git a/src/rgw/driver/d4n/rgw_sal_d4n.cc b/src/rgw/driver/d4n/rgw_sal_d4n.cc index 20c7e3fc93ad..d48dacab6747 100644 --- a/src/rgw/driver/d4n/rgw_sal_d4n.cc +++ b/src/rgw/driver/d4n/rgw_sal_d4n.cc @@ -1282,15 +1282,14 @@ int D4NFilterObject::calculate_version(const DoutPrefixProvider* dpp, optional_y int D4NFilterObject::create_delete_marker(const DoutPrefixProvider* dpp, optional_yield y) { this->delete_marker = true; + char buf[OBJ_INSTANCE_LEN + 1]; + gen_rand_alphanumeric_no_underscore(dpp->get_cct(), buf, OBJ_INSTANCE_LEN); + this->version = buf; + ldpp_dout(dpp, 20) << "D4NFilterObject::" << __func__ << "(): generating delete marker: " << version << dendl; if (this->get_bucket()->versioned() && !this->get_bucket()->versioning_enabled()) { //if versioning is suspended - this->version = "null"; this->set_instance("null"); } else { - char buf[OBJ_INSTANCE_LEN + 1]; - gen_rand_alphanumeric_no_underscore(dpp->get_cct(), buf, OBJ_INSTANCE_LEN); - this->version = buf; // using gen_rand_alphanumeric_no_underscore for the time being this->set_instance(version); - ldpp_dout(dpp, 20) << "D4NFilterObject::" << __func__ << "(): generating delete marker: " << version << dendl; } auto m_time = real_clock::now(); diff --git a/src/rgw/rgw_ssd_driver.cc b/src/rgw/rgw_ssd_driver.cc index fc11f8302186..deea111c27d7 100644 --- a/src/rgw/rgw_ssd_driver.cc +++ b/src/rgw/rgw_ssd_driver.cc @@ -298,9 +298,7 @@ int SSDDriver::restore_blocks_objects(const DoutPrefixProvider* dpp, ObjectDataC obj_key.name = object_name; if (attrs.find(RGW_CACHE_ATTR_VERSION_ID) != attrs.end()) { std::string instance = attrs[RGW_CACHE_ATTR_VERSION_ID].to_str(); - if (instance != "null") { - obj_key.instance = instance; - } + obj_key.instance = instance; } if (attrs.find(RGW_CACHE_ATTR_OBJECT_NS) != attrs.end()) { obj_key.ns = attrs[RGW_CACHE_ATTR_OBJECT_NS].to_str();