From: xie xingguo Date: Wed, 14 Aug 2019 06:12:43 +0000 (+0800) Subject: osd/PrimaryLogPG: fix dirty range of write_full X-Git-Tag: v15.1.0~1838^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e2f278675d185682176d36752428fe397028e60a;p=ceph-ci.git osd/PrimaryLogPG: fix dirty range of write_full A write_full operation may implicitly truncate the object down, hence we need to mark the truncated part as dirty as well since follow-up randomized writes may still be able to (re)extend the object size and leave some holes against the truncated part, which as a result might cause problems during incremental-mode recovery. Note that write_update_size_and_usage would reset oi.size and that's why we move the mark_data_region_dirty call before that. Signed-off-by: xie xingguo --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 23f6dc52211..d0b24b90bbc 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -6401,10 +6401,10 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) } else { obs.oi.clear_data_digest(); } - + ctx->clean_regions.mark_data_region_dirty(0, + std::max((uint64_t)op.extent.length, oi.size)); write_update_size_and_usage(ctx->delta_stats, oi, ctx->modified_ranges, 0, op.extent.length, true); - ctx->clean_regions.mark_data_region_dirty(0, op.extent.length); } break;