From: xie xingguo Date: Tue, 3 Sep 2019 01:59:40 +0000 (+0800) Subject: osd/PrimaryLogPG: update oi.size on write op implicitly truncating object up X-Git-Tag: v15.1.0~1658^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=52caa5b5841e49da3806bd1bf5adce221c42fafb;p=ceph-ci.git osd/PrimaryLogPG: update oi.size on write op implicitly truncating object up See "BlueStore::_do_truncate", bluestore will reset ondisk object size unconditionally to track truncated size. Hence we must adjust logical size (and usage) accordingly to match the specified metrics. Fixes: https://tracker.ceph.com/issues/41601 Signed-off-by: xie xingguo --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index e5a642c44c9..6f8c628b6cb 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -6240,6 +6240,8 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& ops) if (op.extent.offset > oi.size) { t->truncate( soid, op.extent.offset); + truncate_update_size_and_usage(ctx->delta_stats, oi, + op.extent.offset); } else { t->nop(soid); }