From: myoungwon oh Date: Wed, 31 Mar 2021 06:22:01 +0000 (+0900) Subject: osd: remove unnecessary ref handling in _delete_oid X-Git-Tag: v17.1.0~2307^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=779e60e5bc269036700e39c4b8012e0264512a31;p=ceph.git osd: remove unnecessary ref handling in _delete_oid Let's consider the following case when handling a delete op. 1. Delete --> whiteouted 2. Make clone In this case, current code clears chunk_map and calls dec_all_manifest_refcount() in _delete_oid() even if the clone still has the references. To fix this, This commit remove unnecessary ref handling in _delete_oid, and makes finish_ctx() to handle ref handling, which can aware of whether the clone is created or not. Also, remove oi.size == 0 condition in finish_ctx() to handle ref. counting upon a delete op with whitedouted clone. Signed-off-by: Myoungwon Oh --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 68ec1f682e600..c0968d0083470 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -8178,14 +8178,6 @@ inline int PrimaryLogPG::_delete_oid( oi.set_flag(object_info_t::FLAG_WHITEOUT); ctx->delta_stats.num_whiteouts++; t->create(soid); - if (oi.has_manifest()) { - // make no references - dec_all_refcount_manifest(oi, ctx); - oi.manifest.clear(); - oi.manifest.type = object_manifest_t::TYPE_NONE; - oi.clear_flag(object_info_t::FLAG_MANIFEST); - ctx->delta_stats.num_objects_manifest--; - } osd->logger->inc(l_osd_tier_whiteout); return 0; } @@ -8868,7 +8860,6 @@ void PrimaryLogPG::finish_ctx(OpContext *ctx, int log_op_type, int result) // Drop the reference if deduped chunk is modified if (ctx->new_obs.oi.is_dirty() && (ctx->obs->oi.has_manifest() && ctx->obs->oi.manifest.is_chunked()) && - ctx->new_obs.oi.size != 0 && // missing, redirect and delete !ctx->cache_operation && log_op_type != pg_log_entry_t::PROMOTE) { update_chunk_map_by_dirty(ctx);