<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 11/18/2014 06:56 AM, Pranith Kumar Karampuri wrote:<br>
    <blockquote cite="mid:546B5E27.90107@redhat.com" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <br>
      <div class="moz-cite-prefix">On 11/18/2014 05:35 PM, Lindsay
        Mathieson wrote:<br>
      </div>
      <blockquote cite="mid:1491598.G8n7Cy75i9@lindsay-office"
        type="cite">
        <meta name="qrichtext" content="1">
        <style type="text/css">
p, li { white-space: pre-wrap; }
</style>
        <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
          margin-right:0px; -qt-block-indent:0; text-indent:0px;
          -qt-user-state:0;">I have a VM image which is a sparse file -
          512GB allocated, but only 32GB used.</p>
        <p style="-qt-paragraph-type:empty; margin-top:0px;
          margin-bottom:0px; margin-left:0px; margin-right:0px;
          -qt-block-indent:0; text-indent:0px; "> </p>
        <p style="-qt-paragraph-type:empty; margin-top:0px;
          margin-bottom:0px; margin-left:0px; margin-right:0px;
          -qt-block-indent:0; text-indent:0px; "> </p>
        <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
          margin-right:0px; -qt-block-indent:0; text-indent:0px;
          -qt-user-state:0;"><span style=" font-family:'monospace';">root@vnb:~#

            ls -lh /mnt/gluster-brick1/datastore/images/100</span></p>
        <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
          margin-right:0px; -qt-block-indent:0; text-indent:0px;
          -qt-user-state:0;"><span style=" font-family:'monospace';">total

            31G</span></p>
        <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
          margin-right:0px; -qt-block-indent:0; text-indent:0px;
          -qt-user-state:0;"><span style=" font-family:'monospace';">-rw-------

            2 root root 513G Nov 18 19:57 vm-100-disk-1.qcow2</span></p>
        <p style="-qt-paragraph-type:empty; margin-top:0px;
          margin-bottom:0px; margin-left:0px; margin-right:0px;
          -qt-block-indent:0; text-indent:0px; "> </p>
        <p style="-qt-paragraph-type:empty; margin-top:0px;
          margin-bottom:0px; margin-left:0px; margin-right:0px;
          -qt-block-indent:0; text-indent:0px; "> </p>
        <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
          margin-right:0px; -qt-block-indent:0; text-indent:0px;
          -qt-user-state:0;">I switched to full sync and rebooted.</p>
        <p style="-qt-paragraph-type:empty; margin-top:0px;
          margin-bottom:0px; margin-left:0px; margin-right:0px;
          -qt-block-indent:0; text-indent:0px; "> </p>
        <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
          margin-right:0px; -qt-block-indent:0; text-indent:0px;
          -qt-user-state:0;">heal was started on the image and it seemed
          to be just transfering the full file from node vnb to vng.
          iftop showed bandwidth at 500 Mb/s</p>
        <p style="-qt-paragraph-type:empty; margin-top:0px;
          margin-bottom:0px; margin-left:0px; margin-right:0px;
          -qt-block-indent:0; text-indent:0px; "> </p>
        <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
          margin-right:0px; -qt-block-indent:0; text-indent:0px;
          -qt-user-state:0;">Eventually the cumulative transfer got to
          140GB which seemed odd as the real file size was 31G. I logged
          onto the second node (vng) and the *real* file size size was
          up to 191Gb.</p>
        <p style="-qt-paragraph-type:empty; margin-top:0px;
          margin-bottom:0px; margin-left:0px; margin-right:0px;
          -qt-block-indent:0; text-indent:0px; "> </p>
        <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
          margin-right:0px; -qt-block-indent:0; text-indent:0px;
          -qt-user-state:0;">It looks like the heal is not handling
          sparse files, rather it is transferring empty bytes to make up
          the allocated size. Thats a serious problem for the common
          habit of over committing your disk space with vm images. Not
          to mention the inefficiency.</p>
      </blockquote>
      Ah! this problem doesn't exist in diff self-heal :-(. Because the
      checksums of the files will match in the sparse regions. In full
      self-heal it just reads from the source file and writes to the
      sink file. What we can change there is if the file is a sparse
      file and the data that is read is all zeros (read will return all
      zeros as data in the sparse region) then read the stale file and
      compare if it is also all zeros. If both are 'zeros' then skip the
      write. I also checked that if the sparse file is created while the
      other brick is down, then also it preserves the holes(i.e. sparse
      regions). This problem only appears when both the files in their
      full size exist on both the bricks and full self-heal is done like
      here :-(.<br>
      <br>
      Thanks for your valuable inputs. So basically you found 2 issues.
      I will raise 2 bugs one for each of the issues you found. I can CC
      you to the bugzilla, so that you can see the update on the bug
      once it is fixed. Do you want to be CCed to the bug?<br>
    </blockquote>
    <br>
    Hey, nice. This will really speed up full heals for most common vm
    images.<br>
  </body>
</html>