From: myoungwon oh Date: Fri, 1 Oct 2021 01:18:49 +0000 (+0900) Subject: osd: trim corresponding chunks on tier_evict X-Git-Tag: v17.1.0~746^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c08904cee904bc91b1b6beb47a5ef4b55d7670c2;p=ceph.git osd: trim corresponding chunks on tier_evict This commit trims chunks on the object even if the size of the chunks is not equal to the object size. Signed-off-by: Myoungwon Oh --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 6b1a3e52f45b6..163703574a3da 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -7403,20 +7403,14 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) } // The chunks already has a reference, so it is just enough to invoke truncate if necessary - uint64_t chunk_length = 0; - for (auto p : obs.oi.manifest.chunk_map) { - chunk_length += p.second.length; - } - if (chunk_length == obs.oi.size) { - for (auto &p : obs.oi.manifest.chunk_map) { - p.second.set_flag(chunk_info_t::FLAG_MISSING); - } + for (auto &p : obs.oi.manifest.chunk_map) { + p.second.set_flag(chunk_info_t::FLAG_MISSING); // punch hole - t->zero(soid, 0, oi.size); - oi.clear_data_digest(); - ctx->delta_stats.num_wr++; - ctx->cache_operation = true; + t->zero(soid, p.first, p.second.length); } + oi.clear_data_digest(); + ctx->delta_stats.num_wr++; + ctx->cache_operation = true; osd->logger->inc(l_osd_tier_evict); }