]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: update oi.size on write op implicitly truncating object up 30278/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 3 Sep 2019 01:59:40 +0000 (09:59 +0800)
committerPrashant D <pdhange@redhat.com>
Tue, 10 Sep 2019 00:56:36 +0000 (20:56 -0400)
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>
(cherry picked from commit 52caa5b5841e49da3806bd1bf5adce221c42fafb)

src/osd/PrimaryLogPG.cc

index c034383c9f22cad124625f5208b2107fc35ccd82..33f839c4afcc70854207bc3f7375743d982f7999 100644 (file)
@@ -6551,6 +6551,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);
          }