<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:15:31 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-15108] Wrong changelog issued during hsm_restore</title>
                <link>https://jira.whamcloud.com/browse/LU-15108</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Here are the changelogs that we can see while restoring a hsm file:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
30 10OPEN  10:43:26.912661570 2021.10.15 0xcb t=[0x200000402:0xa:0x0] j=lhsmtool_posix.0 ef=0xf u=0:0 nid=10.0.2.6@tcp m=rw-
31 10OPEN  10:43:26.920553291 2021.10.15 0x2 t=[0x200000402:0xa:0x0] j=lhsmtool_posix.0 ef=0xf u=0:0 nid=10.0.2.6@tcp m=-w-
32 16HSM   10:43:26.966607124 2021.10.15 0x0 t=[0x200000402:0x1:0x0] j=lhsmtool_posix.0 ef=0xf u=0:0 nid=10.0.2.6@tcp
33 12LYOUT 10:43:26.967682430 2021.10.15 0x0 t=[0x200000402:0x1:0x0] j=lhsmtool_posix.0 ef=0xf u=0:0 nid=10.0.2.6@tcp
34 16HSM   10:43:26.969154222 2021.10.15 0x80 t=[0x200000402:0x1:0x0] j=lhsmtool_posix.0 ef=0xf u=0:0 nid=10.0.2.6@tcp
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The changelog 32 is wrong: flag: 0x0 -&amp;gt; err=0 hsm_event: HE_ARCHIVE hsm_flag=0&lt;br/&gt;
The changelog 34 is the right one: 0x80 -&amp;gt; err=0 hsm_event: HE_RESTORE hsm_flag=0&lt;/p&gt;

&lt;p&gt;I think  changelog 32 should be set flag to 0x280: err=0 hsm_event: HE_STATE hsm_flag=0&lt;/p&gt;

&lt;p&gt;The wrong flag is positioned because of the following code (when updating hsm state attr):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; mdd_hsm_update_locked(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct lu_env *env,
                                 struct md_object *obj,
                                 &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct lu_buf *buf,
                                 struct thandle *handle,
                                 &lt;span class=&quot;code-keyword&quot;&gt;enum&lt;/span&gt; changelog_rec_flags *clf_flags)
{
.....
       &lt;span class=&quot;code-comment&quot;&gt;/* Flags differ, set flags &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; the changelog that will be added */&lt;/span&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (current_mh-&amp;gt;mh_flags != new_mh-&amp;gt;mh_flags) {                  &amp;lt;----------
                hsm_set_cl_event(clf_flags, HE_STATE);
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (new_mh-&amp;gt;mh_flags &amp;amp; HS_DIRTY)
                        hsm_set_cl_flags(clf_flags, CLF_HSM_DIRTY);
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When restoring a file, hsm xattr is updated by hsm_swap_layouts on the volatile (so no changelog are emitted there):&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; hsm_swap_layouts(struct mdt_thread_info *mti,
                            struct mdt_object *obj, &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct lu_fid *dfid,
                            struct md_hsm *mh_common)
{
.....
        mh_common-&amp;gt;mh_flags &amp;amp;= ~(HS_RELEASED | HS_DIRTY);
        rc = mdt_hsm_attr_set(mti, dobj, mh_common);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So empty HSM changelog is issued by hsm_cdt_request_completed() -&amp;gt; mdt_hsm_attr_set() because hsm state is not modified by this function.&lt;/p&gt;</description>
                <environment>VMs on Lustre master (2.14.54_98_g3db8e31)</environment>
        <key id="66669">LU-15108</key>
            <summary>Wrong changelog issued during hsm_restore</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="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="eaujames">Etienne Aujames</assignee>
                                    <reporter username="eaujames">Etienne Aujames</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Oct 2021 11:17:09 +0000</created>
                <updated>Tue, 2 Nov 2021 10:28:12 +0000</updated>
                                                                                <due></due>
                            <votes>1</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="315722" author="gerrit" created="Fri, 15 Oct 2021 17:15:36 +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/45263&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/45263&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15108&quot; title=&quot;Wrong changelog issued during hsm_restore&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15108&quot;&gt;LU-15108&lt;/a&gt; hsm: HE_STATE should be issued when necessary&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: c2e6e60b64847cc184b02ff22c53012453037803&lt;/p&gt;</comment>
                            <comment id="316830" author="tl-cea" created="Thu, 28 Oct 2021 11:30:11 +0000"  >&lt;p&gt;A side issue is: it is not really expected to have multiple changelog records for a common HSM operation.&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&quot;Archive&quot; , &quot;Release&quot;, &quot;Restore&quot;, &quot;Remove&quot; and &quot;Cancel&quot; should trigger the corresponding HSM changelog (&quot;HE_ARCHIVE&quot;, &quot;HE_RELEASE&quot;, &quot;HE_RESTORE&quot;, &quot;HE_REMOVE&quot;, &quot;HE_CANCEL&quot;)&lt;/li&gt;
	&lt;li&gt;Other hsm state changes should trigger &quot;HE_STATE&quot; (eg. a file is set &quot;dirty&quot;, &quot;lost&quot;...)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Triggering HE_STATE for the common HSM operations (archive...) is redundant. From the Robinhood point of view, it will unnecessarily increase the changelog processing load, and trigger unnecessary &quot;llapi_hsm_state_get()&quot; operation on the filesystem to determine the new HSM state.&lt;br/&gt;
Calling llapi_hsm_state_get() is not necessary for other changelogs (archive etc). as these changelogs do include information about the resulting state in the changelog flags.&lt;/p&gt;

&lt;p&gt;In the reported issue as well as in the proposed patch, these redundant HE_STATE records remain. &lt;/p&gt;</comment>
                            <comment id="317197" author="eaujames" created="Tue, 2 Nov 2021 10:06:26 +0000"  >&lt;p&gt;I have updated the patch above to take into account Thomas&apos;s remark.&lt;/p&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|i027ev:</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>