return false;
}
-void PrimaryLogPG::dec_refcount_by_dirty(OpContext* ctx)
-{
- object_ref_delta_t refs;
- ObjectContextRef cobc = nullptr;
- ObjectContextRef obc = ctx->obc;
+void PrimaryLogPG::update_chunk_map_by_dirty(OpContext* ctx) {
for (auto &p : ctx->obs->oi.manifest.chunk_map) {
if (!ctx->clean_regions.is_clean_region(p.first, p.second.length)) {
ctx->new_obs.oi.manifest.chunk_map.erase(p.first);
}
}
}
+}
+
+void PrimaryLogPG::dec_refcount_by_dirty(OpContext* ctx)
+{
+ object_ref_delta_t refs;
+ ObjectContextRef cobc = nullptr;
+ ObjectContextRef obc = ctx->obc;
// Look over previous snapshot, then figure out whether updated chunk needs to be deleted
cobc = get_prev_clone_obc(obc);
obc->obs.oi.manifest.calc_refs_to_drop_on_modify(
// 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()) &&
- // If a clone is creating, ignore dropping the reference for manifest object
- !ctx->delta_stats.num_object_clones &&
ctx->new_obs.oi.size != 0 && // missing, redirect and delete
!ctx->cache_operation &&
log_op_type != pg_log_entry_t::PROMOTE) {
- dec_refcount_by_dirty(ctx);
+ update_chunk_map_by_dirty(ctx);
+ // If a clone is creating, ignore dropping the reference for manifest object
+ if (!ctx->delta_stats.num_object_clones) {
+ dec_refcount_by_dirty(ctx);
+ }
}
// finish and log the op.
Context *cb, std::optional<bufferlist> chunk);
void dec_all_refcount_manifest(const object_info_t& oi, OpContext* ctx);
void dec_refcount(const hobject_t& soid, const object_ref_delta_t& refs);
+ void update_chunk_map_by_dirty(OpContext* ctx);
void dec_refcount_by_dirty(OpContext* ctx);
ObjectContextRef get_prev_clone_obc(ObjectContextRef obc);
bool recover_adjacent_clones(ObjectContextRef obc, OpRequestRef op);