]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/PrimaryLogPG: update oi.size on write op implicitly truncating object up
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 3 Sep 2019 01:59:40 +0000 (09:59 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 3 Sep 2019 02:20:53 +0000 (10:20 +0800)
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 <xie.xingguo@zte.com.cn>
src/osd/PrimaryLogPG.cc

index e5a642c44c9541fbc370aa568e74ebcfb169b0de..6f8c628b6cb5bd981453859467059430575d9425 100644 (file)
@@ -6240,6 +6240,8 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& 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);
          }