From: myoungwon oh Date: Sat, 31 Oct 2020 12:25:47 +0000 (+0900) Subject: osd: send decrement message to only target chunks (not all chunks) X-Git-Tag: v16.1.0~374^2~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c970c7a464a550a5a1399fde5a57c88bc0714e52;p=ceph.git osd: send decrement message to only target chunks (not all chunks) Signed-off-by: Myoungwon Oh --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 87b3882ee3d0..a93274b1cfd8 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -10227,18 +10227,7 @@ void PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64 return; } - // drop all references the current chunk_map has object_ref_delta_t refs; - for (auto p : obc->obs.oi.manifest.chunk_map) { - refs.dec_ref(p.second.oid); - } - if (!refs.is_empty()) { - ctx->register_on_commit( - [oid, this, refs](){ - dec_refcount(oid, refs); - }); - } - ctx->at_version = get_next_version(); ctx->new_obs = obc->obs; ctx->new_obs.oi.clear_flag(object_info_t::FLAG_DIRTY); @@ -10248,6 +10237,14 @@ void PrimaryLogPG::finish_set_dedup(hobject_t oid, int r, ceph_tid_t tid, uint64 info.length = p.second.second; info.oid = p.first; ctx->new_obs.oi.manifest.chunk_map[p.second.first] = info; + // drop all references issued before + refs.dec_ref(p.first); + } + if (!refs.is_empty()) { + ctx->register_on_commit( + [oid, this, refs](){ + dec_refcount(oid, refs); + }); } finish_ctx(ctx.get(), pg_log_entry_t::CLEAN);