<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:25:16 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-2445] add &quot;lfs migrate&quot; support</title>
                <link>https://jira.whamcloud.com/browse/LU-2445</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Once the &quot;layout swap&quot; support in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-2017&quot; title=&quot;Layout swapping, client  and MDT parts&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-2017&quot;&gt;&lt;del&gt;LU-2017&lt;/del&gt;&lt;/a&gt; (&lt;a href=&quot;http://review.whamcloud.com/4507&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/4507&lt;/a&gt;) is landed, the client will have an API to atomically swap the layout between two files.&lt;/p&gt;

&lt;p&gt;In order for this functionality to be useful for users, the &lt;tt&gt;llapi_layout_swap()&lt;/tt&gt; function needs to be wrapped in some additional code compared to &lt;tt&gt;lfs swap_layouts&lt;/tt&gt; to ensure that the file isn&apos;t changing during the copy, and to do the actual copy.&lt;/p&gt;

&lt;p&gt;I propose an &lt;tt&gt;lfs migrate&lt;/tt&gt; command that takes the same arguments as &lt;tt&gt;lfs setstripe&lt;/tt&gt; (calling into lfs_setstripe() to create the target file, for simplicity and compatibility, though with some option to make it an open-unlinked file via &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-2441&quot; title=&quot;Temporary file support&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-2441&quot;&gt;&lt;del&gt;LU-2441&lt;/del&gt;&lt;/a&gt;), gets an exclusive lock on the file (group lock or client-side layout lock), and then copies the file contents from the source to the target.  By reading the whole source file, this will natually cause any clients with unwritten data to flush their caches when their write-extent locks are cancelled.  Once the copy is completed (optionally verifying the data checksum after flushing the client cache?) the llapi_layout_swap() function is called, and the &quot;new&quot; open-unlinked file descriptor layout (which now points to the old objects) is closed, causing those objects to be destroyed.  The exclusive lock can be dropped.&lt;/p&gt;

&lt;p&gt;If the MDS does not support MDS_SWAP_LAYOUTS then &lt;tt&gt;lfs migrate&lt;/tt&gt; should return an -EOPNOTSUPP error, so that users are aware that atomic layout swap is not available.&lt;/p&gt;

&lt;p&gt;The &lt;tt&gt;lfs_migrate&lt;/tt&gt; script should call the &lt;tt&gt;lfs migrate&lt;/tt&gt; command to do the migrate/copy (instead of &lt;tt&gt;rsync&lt;/tt&gt; + &lt;tt&gt;mv&lt;/tt&gt;).   but &lt;tt&gt;lfs_migrate&lt;/tt&gt; probably needs to fall back to rsync+mv again.  The &lt;tt&gt;lfs_migrate&lt;/tt&gt; script has not previously guaranteed atomic migration, so it should continue to work using rsync+mv as it has in the past if &quot;lfs migrate&quot; returns EOPNOTSUPP, with a comment to the effect that this functionality should be removed after Lustre 2.10 or so.&lt;/p&gt;</description>
                <environment></environment>
        <key id="16875">LU-2445</key>
            <summary>add &quot;lfs migrate&quot; support</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</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="jay">Jinshan Xiong</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 Dec 2012 16:23:31 +0000</created>
                <updated>Sat, 21 Feb 2015 00:32:28 +0000</updated>
                            <resolved>Sat, 21 Feb 2015 00:32:28 +0000</resolved>
                                    <version>Lustre 2.4.0</version>
                                    <fixVersion>Lustre 2.4.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>16</watches>
                                                                            <comments>
                            <comment id="48929" author="johann" created="Fri, 7 Dec 2012 16:30:37 +0000"  >&lt;p&gt;Andreas, i am afraid that the current layout lock implementation is only suitable for HSM and more work is required to support layout revocation of opened files (for which there can be read/write request in flight).&lt;/p&gt;</comment>
                            <comment id="48930" author="adilger" created="Fri, 7 Dec 2012 16:36:58 +0000"  >&lt;p&gt;Johann, can you please file a bug with the details of what still needs to be implemented for the full layout lock support, or if one already exists please link it to this bug.&lt;/p&gt;</comment>
                            <comment id="48934" author="rread" created="Fri, 7 Dec 2012 18:34:04 +0000"  >&lt;p&gt;If the new objects have earlier version numbers than the old objects (because they are on new OSTs perhaps), then will this have a effect on HSM?  Will HSM still archive the data if the version looks older than what is currently in the archive?&lt;/p&gt;
</comment>
                            <comment id="52161" author="jcl" created="Mon, 11 Feb 2013 15:43:12 +0000"  >&lt;p&gt;Please assign me this LU (or to jody) , I will work on a patch&lt;/p&gt;</comment>
                            <comment id="53401" author="jcl" created="Tue, 5 Mar 2013 19:21:31 +0000"  >&lt;p&gt;I will initially implement it in lfs_setstripe() directly so any re-stripe call will do the migration. I think I have to take a group lock for force flush from others and get exclusive access during copy.&lt;/p&gt;</comment>
                            <comment id="53410" author="jay" created="Wed, 6 Mar 2013 01:09:33 +0000"  >&lt;p&gt;Here is a flow chart for migration I proposed in Beijing. Please take a look.&lt;/p&gt;</comment>
                            <comment id="53421" author="jcl" created="Wed, 6 Mar 2013 05:04:06 +0000"  >&lt;p&gt;OpenEx + dataversion is perfect I will implement this soon&lt;/p&gt;</comment>
                            <comment id="53445" author="adilger" created="Wed, 6 Mar 2013 10:50:30 +0000"  >&lt;p&gt;JC, since the current behaviour of setstripe on an existing file is to return an error, it isn&apos;t clear to me if changing this to do internal migration and data copying would be &quot;obvious&quot; to users or not. It does have a certain appeal, however, so I think it should be discussed more. &lt;/p&gt;

&lt;p&gt;Could you please send and email (hpdd-discuss and lustre-discuss) to ask for done input on the user interface. I was thinking it makes more sense to require an explicit call to migrate the file data, since this may take a long time.&lt;/p&gt;

&lt;p&gt;If the setstripe approach is taken, it should definitely only migrate the file if a different layout is explicitly given.&lt;/p&gt;</comment>
                            <comment id="53450" author="jcl" created="Wed, 6 Mar 2013 11:26:46 +0000"  >&lt;p&gt; let&apos;s start with lfs migrate, have it working and we will ask to the list later&lt;/p&gt;</comment>
                            <comment id="53479" author="jcl" created="Wed, 6 Mar 2013 16:49:55 +0000"  >&lt;p&gt;Patch at &lt;a href=&quot;http://review.whamcloud.com/5620&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/5620&lt;/a&gt;&lt;br/&gt;
This is a first tentative because it does not add the support of O_EXCL as requested by Jinshan&lt;/p&gt;</comment>
                            <comment id="53510" author="adilger" created="Thu, 7 Mar 2013 02:21:03 +0000"  >&lt;p&gt;For use by the &quot;lfs_migrate&quot; script, this is sufficient for use today, since that script is already not safe for files being modified.  It is better than the simple cp + checksum method, since it preserves the inode numbers and would also keep open file handles for read or write, so long as they are not actively writing during migration. &lt;/p&gt;

&lt;p&gt;&quot;lfs migrate&quot; probably needs a comment in the usage message to indicate it is not totally safe for files that are actively undergoing IO.  It might also make sense to have an upper limit on the number of times it will try to migrate the file in the loop when the data version has changed, and continue to try any other files. It should save an error if this happens (maybe EBUSY) and return it at the end, so that it is clear to the user that the migrate was not totally successful. &lt;/p&gt;</comment>
                            <comment id="53544" author="jay" created="Thu, 7 Mar 2013 12:48:11 +0000"  >&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;This is a first tentative because it does not add the support of O_EXCL as requested by Jinshan
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Exclusive open is lustre specific which is not simply O_EXCL. We should make it clear at initial start otherwise people will be confused.&lt;/p&gt;

&lt;p&gt;Andreas, would you suggest a name please?&lt;/p&gt;</comment>
                            <comment id="53670" author="adilger" created="Mon, 11 Mar 2013 01:06:23 +0000"  >&lt;p&gt;I think it would make sense to ensure that exclusive open has the same semantics as leases, so that we do not need to implement something similar but slightly different in the future. I believe they have a similar semantic if notifying the client, but do not necessarily revoke the client lease immediately.&lt;/p&gt;

&lt;p&gt;To be honesty, I think we could get fairly similar behavior with regular MDS DLM locks, if they could be dropped asynchronously if there is a failure on one of the OSTs.  The client would get a DLM layout lock, register a callback to userspace for any blocking callback event, and if the userspace thread isn&apos;t responsive in time then the lock is cancelled anyway (as it is today) and e.g. the open file handle is invalidated. That gives userspace some limited time to finish or snort migration, and in almost all cases this will be sufficient, just like for regular clients.&lt;/p&gt;

&lt;p&gt;This was actually in the original migration design at &lt;a href=&quot;https://bugzilla.lustre.org/show_bug.cgi?id=13182&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://bugzilla.lustre.org/show_bug.cgi?id=13182&lt;/a&gt; and related bugs.&lt;/p&gt;

&lt;p&gt;Thoughts?&lt;/p&gt;</comment>
                            <comment id="54816" author="pjones" created="Tue, 26 Mar 2013 04:49:59 +0000"  >&lt;p&gt;Dropped priority because patch landed for 2.4&lt;/p&gt;</comment>
                            <comment id="56171" author="adilger" created="Fri, 12 Apr 2013 01:13:57 +0000"  >&lt;p&gt;With the landing of the latest patch, is it now safe to do &quot;lfs migrate &lt;span class=&quot;error&quot;&gt;&amp;#91;--block&amp;#93;&lt;/span&gt;&quot; on a file that is in use and actively undergoing IO?  If yes, this would be a great feature coming from the HSM to announce for 2.4, even though the full HSM functionality is not yet available.&lt;/p&gt;</comment>
                            <comment id="56181" author="jay" created="Fri, 12 Apr 2013 03:10:51 +0000"  >&lt;blockquote&gt;
&lt;p&gt;With the landing of the latest patch, is it now safe to do &quot;lfs migrate &lt;span class=&quot;error&quot;&gt;&amp;#91;--block&amp;#93;&lt;/span&gt;&quot; on a file that is in use and actively undergoing IO? &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Yes.&lt;/p&gt;</comment>
                            <comment id="62065" author="adilger" created="Wed, 10 Jul 2013 22:54:14 +0000"  >&lt;p&gt;Before this bug can be closed, we need to update the user manual to describe this feature.&lt;/p&gt;</comment>
                            <comment id="68514" author="keith" created="Mon, 7 Oct 2013 17:42:55 +0000"  >&lt;p&gt;+1 on this being a very cool thing. &quot;lfs migrate &lt;span class=&quot;error&quot;&gt;&amp;#91;--block&amp;#93;&lt;/span&gt;&quot; allows in filesystem data migration. Is there a lustre-test for this? &lt;/p&gt;</comment>
                            <comment id="68563" author="adilger" created="Tue, 8 Oct 2013 06:03:58 +0000"  >&lt;p&gt;There is sanity.sh test_56w(), though it doesn&apos;t appear this verifies the data...&lt;/p&gt;</comment>
                            <comment id="68592" author="keith" created="Tue, 8 Oct 2013 15:51:19 +0000"  >&lt;p&gt;Thanks I will look at expanding the testing a bit.  &lt;/p&gt;</comment>
                            <comment id="98697" author="fzago" created="Fri, 7 Nov 2014 21:24:31 +0000"  >&lt;p&gt;Minor fix: &lt;a href=&quot;http://review.whamcloud.com/12627&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/12627&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="105533" author="gerrit" created="Tue, 3 Feb 2015 18:07:55 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/12627/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/12627/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-2445&quot; title=&quot;add &amp;quot;lfs migrate&amp;quot; support&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-2445&quot;&gt;&lt;del&gt;LU-2445&lt;/del&gt;&lt;/a&gt; lfs: fixed support for lfs migrate -b&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 04cc64d30160bd424f7ff151592b43ed0e68571c&lt;/p&gt;</comment>
                            <comment id="107575" author="adilger" created="Sat, 21 Feb 2015 00:32:28 +0000"  >&lt;p&gt;This was primarily landed in Lustre 2.4.0, but a number of related fixes have been landed since then.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="22208">LU-4293</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="12282" name="migration.png" size="15274" author="jay" created="Wed, 6 Mar 2013 01:09:33 +0000"/>
                    </attachments>
                <subtasks>
                            <subtask id="17780">LU-2919</subtask>
                    </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_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzvdev:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5779</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>