<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:55:27 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-5895] lfs: data version changed during migration</title>
                <link>https://jira.whamcloud.com/browse/LU-5895</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Archiving, releasing then migrating leads to a &quot;data version changed during migration&quot;:&lt;/p&gt;

&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;# cd /mnt/lustre
# cp /usr/bin/zip .
# lfs getstripe zip
zip
lmm_stripe_count:   1
lmm_stripe_size:    1048576
lmm_pattern:        1
lmm_layout_gen:     0
lmm_stripe_offset:  1
	obdidx		 objid		 objid		 group
	     1	             2	          0x2	             0
# lfs hsm_archive zip
# lfs hsm_release zip
# lfs hsm_state zip
zip: (0x0000000d) released exists archived, archive_id:1
# lfs getstripe zip
zip
lmm_stripe_count:   1
lmm_stripe_size:    1048576
lmm_pattern:        80000001
lmm_layout_gen:     1
lmm_stripe_offset:  0
# lfs migrate -o 0 zip
/root/lustre-cleanup/lustre/utils/lfs: zip: data version changed during migration
error: migrate: migrate stripe file &apos;zip&apos; failed
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think the file is restored first, then migrated, but its data version is not updated. Which lead to the following questions:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;is it correct to force a restore of an archived file when asking for a migrate operation?&lt;/li&gt;
	&lt;li&gt;couldn&apos;t the file be restored directly to the proper OST/stripe size, ...?&lt;/li&gt;
	&lt;li&gt;although an error is reported, the file is present and complete, so the operation actually completed properly. What if that was another kind of error? Would we get a data corruption?&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment>head of tree + &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-4840&quot; title=&quot; Deadlock when truncating file during lfs migrate&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-4840&quot;&gt;&lt;strike&gt;LU-4840&lt;/strike&gt;&lt;/a&gt;</environment>
        <key id="27529">LU-5895</key>
            <summary>lfs: data version changed during migration</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="1" iconUrl="https://jira.whamcloud.com/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="bevans">Ben Evans</assignee>
                                    <reporter username="fzago">Frank Zago</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Mon, 10 Nov 2014 20:38:16 +0000</created>
                <updated>Wed, 29 May 2019 17:16:42 +0000</updated>
                                            <version>Lustre 2.7.0</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>10</watches>
                                                                            <comments>
                            <comment id="98811" author="fzago" created="Mon, 10 Nov 2014 20:49:37 +0000"  >&lt;p&gt;After the &quot;failed&quot; migration, getstripes return this:&lt;/p&gt;
&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;# lfs getstripe zip
zip
lmm_stripe_count:   1
lmm_stripe_size:    1048576
lmm_pattern:        1
lmm_layout_gen:     2
lmm_stripe_offset:  0
	obdidx		 objid		 objid		 group
	     0	             3	          0x3	             0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So the file has indeed migrated, and is not the original one simply restored.&lt;/p&gt;</comment>
                            <comment id="98813" author="jay" created="Mon, 10 Nov 2014 21:36:41 +0000"  >&lt;p&gt;HSM may not allocate the original OST to restore the file, thus your example can&apos;t verify that the migration has completed. Please try to migrate the released file to have 2 stripes and see how it goes.&lt;/p&gt;</comment>
                            <comment id="98814" author="fzago" created="Mon, 10 Nov 2014 21:42:01 +0000"  >&lt;p&gt;When I archive/restore a file, the objid stays the same. It&apos;s not the case here.&lt;/p&gt;

&lt;p&gt;I&apos;ll try with 2 stripes.&lt;/p&gt;</comment>
                            <comment id="98816" author="fzago" created="Mon, 10 Nov 2014 21:50:46 +0000"  >&lt;p&gt;When I tried migrating to 2 stripes, the file was restored to only one stripe. So that part looks ok actually. That third question is now moot. The first 2 remain.&lt;/p&gt;</comment>
                            <comment id="98820" author="jay" created="Mon, 10 Nov 2014 22:32:20 +0000"  >&lt;p&gt;I think the 3rd question is a BUG. I didn&apos;t look into the code, but I guess the root cause of this problem is that zero data version was returned for released file, but later after file was restored it saw different data version.&lt;/p&gt;

&lt;p&gt;The 2nd question is a good one. The question can be refined to support setstripe style of restore operation, in another word, the command `lfs hsm_restore&apos; should be able to override original stripe pattern.&lt;/p&gt;</comment>
                            <comment id="100450" author="adilger" created="Tue, 2 Dec 2014 18:44:27 +0000"  >&lt;p&gt;I have to question whether it even makes sense to migrate a released file?  Maybe this should just become a no-op?&lt;/p&gt;</comment>
                            <comment id="100461" author="rread" created="Tue, 2 Dec 2014 19:01:06 +0000"  >&lt;p&gt;Yes, it does sense to skip migration for a released file since there is no data to migrate as far as Lustre is concerned.&lt;/p&gt;</comment>
                            <comment id="102009" author="adilger" created="Thu, 18 Dec 2014 22:31:27 +0000"  >&lt;p&gt;Frank, would you be able to make a patch to just return 0 (do nothing) if trying to migrate a file that is already released?&lt;/p&gt;</comment>
                            <comment id="103120" author="fzago" created="Sat, 10 Jan 2015 00:27:42 +0000"  >&lt;p&gt;I missed that message. I&apos;ll send a patch.&lt;/p&gt;</comment>
                            <comment id="103267" author="gerrit" created="Mon, 12 Jan 2015 21:54:28 +0000"  >&lt;p&gt;frank zago (fzago@cray.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/13356&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/13356&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5895&quot; title=&quot;lfs: data version changed during migration&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5895&quot;&gt;LU-5895&lt;/a&gt; lfs: prevent migration of a released file&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 28d3e178ee1a9f98f6c7926b5dafca778e98c4e5&lt;/p&gt;</comment>
                            <comment id="103270" author="fzago" created="Mon, 12 Jan 2015 22:00:57 +0000"  >&lt;p&gt;I&apos;ve made lfs return an error if the file has been released. I believe it&apos;s better to fail than to mislead the user.&lt;/p&gt;

&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;# ./lfs migrate /mnt/lustre/zip
/mnt/lustre/zip: can&apos;t migrate a file released by HSM
error: migrate: migrate stripe file &apos;/mnt/lustre/zip&apos; failed
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But this patch doesn&apos;t completely cover the bad case. For instance what happens if there is a race between a release and migrate operation. If the check for the release bit succeeds, then the migrate operation will happen, and the &quot;data version changed during migration&quot; message will be displayed, but the file will be restored. I don&apos;t see a solution for that, but we might be able to live with it.&lt;/p&gt;</comment>
                            <comment id="104755" author="fzago" created="Mon, 26 Jan 2015 21:39:15 +0000"  >&lt;p&gt;I will update that patch according to Henri&apos;s suggestion:&lt;/p&gt;
&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;Wouldn&apos;t it make sense to migrate released files like this:
- Open volatile file with O_LOV_DELAY_CREAT
- Assign it the desired stripe
- Swap layouts with the released file

This is totally untested, but I believe it could work and prevent from having to restore released files for the sole purpose of migrating them.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is however depending on &quot;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6081&quot; title=&quot;hsm: add file migrate support&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6081&quot;&gt;LU-6081&lt;/a&gt; user: Introducing llapi_create_volatile_param()&quot;, which itself will need &quot;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5657&quot; title=&quot;adding missing man pages for the Lustre user API&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5657&quot;&gt;&lt;del&gt;LU-5657&lt;/del&gt;&lt;/a&gt; allow the use of rst2man to build man pages&quot;&lt;/p&gt;</comment>
                            <comment id="104790" author="fzago" created="Tue, 27 Jan 2015 00:57:05 +0000"  >&lt;p&gt;I wrote the code for it and a basic test (not pushed). 2 problems:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;llapi_fswap_layouts returns -524, which is not a valid error code. Logs indicate it is coming from cl_get_grouplock() in file.c:1660&lt;/li&gt;
	&lt;li&gt;if I disable the request for a group lock in llapi_fswap_layouts(), then the swap works, but the resulting file size is 0. Maybe there is some other operations to do (like setting the released flag on the volatile before swapping).&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                    <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_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzx0lz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>16474</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>