<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:00:56 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-13397] lfs migrate/mirror extend/resync does not preserve sparse file</title>
                <link>https://jira.whamcloud.com/browse/LU-13397</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;While testing &quot;&lt;tt&gt;lfs migrate&lt;/tt&gt;&quot;, &quot;&lt;tt&gt;lfs mirror extend&lt;/tt&gt;&quot;, and &quot;&lt;tt&gt;lfs mirror resync&lt;/tt&gt;&quot;, I was doing high-offset writes to initialize later PFL components of the file layout (e.g. at 1GB offset and 32GB offset).  When trying to mirror/resync those files to another mirror copy, it resulted in the commands failing due to &lt;tt&gt;ENOSPC&lt;/tt&gt; because there was not enough free space in the test filesystem to write out the data.&lt;/p&gt;

&lt;p&gt;These commands should be updated to share a common &quot;data copy&quot; routine (if they don&apos;t already) to reduce code duplication when fixing these issues.  Then, the code needs to handle sparse input files properly, first by checking for sparse files (e.g. blocks &amp;lt;&amp;lt; size) to enable checking the source file, and not copying holes in the file.  There should probably be options added for each command like &quot;&lt;tt&gt;--sparse=&amp;lt;auto,no,yes&amp;gt;&lt;/tt&gt;&quot; (default = &lt;tt&gt;auto&lt;/tt&gt;) to force a specific behavior.&lt;/p&gt;

&lt;p&gt;Unfortunately, there is no optimal way to handle reading of sparse files in Lustre today.  In all cases, it makes little sense to be doing these operations on in-use files, so there are already checks if the file is modified during migrate/mirror/resync.&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;For 1-stripe files, the &lt;tt&gt;ioctl(FIEMAP)&lt;/tt&gt; will return a &lt;em&gt;current&lt;/em&gt; map of data for the file (it flushes data if &lt;tt&gt;FIEMAP_FLAG_SYNC&lt;/tt&gt; is used, but doesn&apos;t prevent further modification).  Multi-stripe and PFL files return multiple maps in per-object offset order, and that is not useful if the files are using different layouts (likely a common case).  Also, ZFS does not yet support &lt;tt&gt;FIEMAP&lt;/tt&gt; despite some efforts in that direction.&lt;/li&gt;
	&lt;li&gt;Using &lt;tt&gt;SEEK_HOLE&lt;/tt&gt; and &lt;tt&gt;SEEK_DATA&lt;/tt&gt; would be the preferred solution, but this needs a Lustre-level update to pass these through from the client to the OST (and MDT for DoM).  This is described in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10801&quot; title=&quot;argument parsing in lfs_migrate is broken&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10801&quot;&gt;&lt;del&gt;LU-10801&lt;/del&gt;&lt;/a&gt;, and may be able to leverage some infrastructure from the patch &lt;a href=&quot;https://review.whamcloud.com/9275&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/9275&lt;/a&gt; &quot;&lt;tt&gt;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-3606&quot; title=&quot;Implement fallocate() support for ldiskfs Lustre&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-3606&quot;&gt;&lt;del&gt;LU-3606&lt;/del&gt;&lt;/a&gt; fallocate: Implement fallocate preallocate operation&lt;/tt&gt;&quot;.  While &lt;tt&gt;SEEK_HOLE&lt;/tt&gt; and &lt;tt&gt;SEEK_DATA&lt;/tt&gt; &quot;work&quot; for Lustre by kernel emulation, they just assume that every block is &quot;data&quot; and the first hole is the end of the file.&lt;/li&gt;
	&lt;li&gt;The simplest (though least efficient) option would be to do zero-block detection during the copy phase.  This has quite high CPU and IO overhead, because it requires reading the whole file and checking every byte.  It would only be done if the file appears to be very sparse, and the layout is complex (i.e. not single stripe where &lt;tt&gt;FIEMAP&lt;/tt&gt; is useful).&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="58545">LU-13397</key>
            <summary>lfs migrate/mirror extend/resync does not preserve sparse file</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="tappro">Mikhail Pershin</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>HPv3</label>
                            <label>HPv4p1</label>
                    </labels>
                <created>Sat, 28 Mar 2020 00:14:13 +0000</created>
                <updated>Fri, 17 Mar 2023 19:48:49 +0000</updated>
                            <resolved>Wed, 26 Jan 2022 19:38:22 +0000</resolved>
                                                    <fixVersion>Lustre 2.15.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>11</watches>
                                                                            <comments>
                            <comment id="266292" author="adilger" created="Sat, 28 Mar 2020 00:33:58 +0000"  >&lt;p&gt;Another option here (that could also be very useful for other reasons) might be to allow specifying &quot;&lt;tt&gt;--copy-cmd&lt;/tt&gt;&quot; for these tools to offload the handling of the data movement from &quot;&lt;tt&gt;lfs&lt;/tt&gt;&quot;.  The &quot;&lt;tt&gt;lfs migrate/mirror&lt;/tt&gt;&quot; command would handle creating the file layout and opening file handles for the source and destination, and then execute &quot;&lt;tt&gt;copy-cmd %s %s&lt;/tt&gt;&quot;, e.g. &quot;&lt;tt&gt;cp --sparse=auto $src $tgt&lt;/tt&gt;&quot; or &quot;&lt;tt&gt;dcp $src $tgt&lt;/tt&gt;&quot;.  It would be possible for &quot;&lt;tt&gt;lfs migrate&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;lfs mirror extend&lt;/tt&gt;&quot; to potentially use a copy command that only worked on filenames instead of file handles, and then use layout swap or layout merge with a temporary victim file (the victim file could be volatile and accessed via &lt;tt&gt;$MOUNT/.lustre/fid/$FID&lt;/tt&gt;).&lt;/p&gt;

&lt;p&gt;This is not necessarily possible for &quot;&lt;tt&gt;lfs mirror resync&lt;/tt&gt;&quot; which needs to use &lt;tt&gt;O_DIRECT&lt;/tt&gt; file handles to avoid cache issues on the file. It &lt;em&gt;might&lt;/em&gt; be possible to pass the open handles to tools via &quot;&lt;tt&gt;/dev/stdin&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;/dev/stdout&lt;/tt&gt;&quot; as the pathnames, but that isn&apos;t clear it would work for all cases (e.g. tool running on another node), but it wouldn&apos;t have to support every combination of uses.  Alternately, a pathname like &quot;&lt;tt&gt;$MOUNT/.lustre/fid/&lt;span class=&quot;error&quot;&gt;&amp;#91;fid_seq:fid_oid:0&amp;#93;&lt;/span&gt;.comp_id&lt;/tt&gt;&quot; could be used to open a specific component of the file if the VFS treated the different open-by-FID paths as different inodes?  Just an idea.&lt;/p&gt;</comment>
                            <comment id="284191" author="gerrit" created="Tue, 3 Nov 2020 23:24:27 +0000"  >&lt;p&gt;Mike Pershin (mpershin@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/40530&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/40530&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13397&quot; title=&quot;lfs migrate/mirror extend/resync does not preserve sparse file&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13397&quot;&gt;&lt;del&gt;LU-13397&lt;/del&gt;&lt;/a&gt; hsm: lhsmtool to handle sparse files&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: ae180a1080dc1cb3990d8f53caee95e11a160248&lt;/p&gt;</comment>
                            <comment id="286125" author="gerrit" created="Thu, 26 Nov 2020 22:01:41 +0000"  >&lt;p&gt;Mike Pershin (mpershin@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/40772&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/40772&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13397&quot; title=&quot;lfs migrate/mirror extend/resync does not preserve sparse file&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13397&quot;&gt;&lt;del&gt;LU-13397&lt;/del&gt;&lt;/a&gt; lfs: mirror extend/copy keeps sparseness&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 5b38421a548116edb5e45d3cdbd0fd6d2f09e314&lt;/p&gt;</comment>
                            <comment id="286126" author="gerrit" created="Thu, 26 Nov 2020 22:24:00 +0000"  >&lt;p&gt;Mike Pershin (mpershin@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/40773&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/40773&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13397&quot; title=&quot;lfs migrate/mirror extend/resync does not preserve sparse file&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13397&quot;&gt;&lt;del&gt;LU-13397&lt;/del&gt;&lt;/a&gt; lfs: mirror resync to keep sparseness&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: e916affaabd65e55222431eebfaa92aa6d54989b&lt;/p&gt;</comment>
                            <comment id="293729" author="lixi_wc" created="Wed, 3 Mar 2021 10:07:48 +0000"  >&lt;p&gt;&quot;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-14174&quot; title=&quot;errors from llapi_mirror_find() are not checked correctly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-14174&quot;&gt;&lt;del&gt;LU-14174&lt;/del&gt;&lt;/a&gt; lfs: llapi_mirror_find() return code check&quot; is also in &lt;a href=&quot;https://review.whamcloud.com/#/c/40773/9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/#/c/40773/9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="297168" author="gerrit" created="Tue, 30 Mar 2021 04:15:40 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/40772/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/40772/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13397&quot; title=&quot;lfs migrate/mirror extend/resync does not preserve sparse file&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13397&quot;&gt;&lt;del&gt;LU-13397&lt;/del&gt;&lt;/a&gt; lfs: mirror extend/copy keeps sparseness&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 0561c144cc1bb623e05d08b5055009e8d86047f4&lt;/p&gt;</comment>
                            <comment id="297862" author="gerrit" created="Tue, 6 Apr 2021 03:02:05 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/40773/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/40773/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13397&quot; title=&quot;lfs migrate/mirror extend/resync does not preserve sparse file&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13397&quot;&gt;&lt;del&gt;LU-13397&lt;/del&gt;&lt;/a&gt; lfs: mirror resync to keep sparseness&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 4126fbb30c125050ea2e1fdf3d446201b826ce29&lt;/p&gt;</comment>
                            <comment id="310425" author="tappro" created="Tue, 17 Aug 2021 15:13:45 +0000"  >&lt;p&gt;I&apos;ve found the problem with mirror resync and sparse file, it is not working as intended, so I am keeping ticket opened.&lt;/p&gt;

&lt;p&gt;The problem is in fallocate punch operation during resync. If it is done prior write operation then write itself fails due to changed layout version.&lt;/p&gt;</comment>
                            <comment id="310820" author="gerrit" created="Sun, 22 Aug 2021 20:04:10 +0000"  >&lt;p&gt;&quot;Mike Pershin &amp;lt;mpershin@whamcloud.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/44721&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/44721&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13397&quot; title=&quot;lfs migrate/mirror extend/resync does not preserve sparse file&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13397&quot;&gt;&lt;del&gt;LU-13397&lt;/del&gt;&lt;/a&gt; llite: support fallocate() on selected mirror&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 84ab0da804fda75262dd0022528d0043cb3e4558&lt;/p&gt;</comment>
                            <comment id="313597" author="gerrit" created="Wed, 22 Sep 2021 04:41:38 +0000"  >&lt;p&gt;&quot;Oleg Drokin &amp;lt;green@whamcloud.com&amp;gt;&quot; merged in patch &lt;a href=&quot;https://review.whamcloud.com/44721/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/44721/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13397&quot; title=&quot;lfs migrate/mirror extend/resync does not preserve sparse file&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13397&quot;&gt;&lt;del&gt;LU-13397&lt;/del&gt;&lt;/a&gt; llite: support fallocate() on selected mirror&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 89736d502cc99f095237dde7520fc4ca86191882&lt;/p&gt;</comment>
                            <comment id="366293" author="gerrit" created="Fri, 17 Mar 2023 19:48:49 +0000"  >&lt;p&gt;&quot;Etienne AUJAMES &amp;lt;eaujames@ddn.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/50329&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/50329&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13397&quot; title=&quot;lfs migrate/mirror extend/resync does not preserve sparse file&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13397&quot;&gt;&lt;del&gt;LU-13397&lt;/del&gt;&lt;/a&gt; lfs: mirror extend/copy keeps sparseness&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: d36e3f1a5599eb557e07550651d855c19d18ca36&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="51334">LU-10810</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="61844">LU-14176</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="61799">LU-14160</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="20606">LU-3833</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10092" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>EX-6005</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i00wk7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>