<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:46:08 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-11695] disabling the xattr cache on client for LSOM</title>
                <link>https://jira.whamcloud.com/browse/LU-11695</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Currently, to get uptodate LSOM data, we need to set llite.*.xattr_cache=0 to disable the xattr cache on client completely. This may lead that other kind of xattr can not be cached on client too.&lt;/p&gt;

&lt;p&gt;This ticket mainly focues on the heavy-weight solution to disable caching only for LSOM xattr data (&quot;trusted.som&quot;) on client.&lt;/p&gt;</description>
                <environment></environment>
        <key id="54095">LU-11695</key>
            <summary>disabling the xattr cache on client for LSOM</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</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="qian_wc">Qian Yingjin</assignee>
                                    <reporter username="qian_wc">Qian Yingjin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Nov 2018 08:06:42 +0000</created>
                <updated>Tue, 28 Mar 2023 13:08:12 +0000</updated>
                            <resolved>Mon, 11 Jul 2022 12:56:27 +0000</resolved>
                                                    <fixVersion>Lustre 2.16.0</fixVersion>
                    <fixVersion>Lustre 2.15.3</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="237408" author="gerrit" created="Fri, 23 Nov 2018 08:17:43 +0000"  >&lt;p&gt;Yingjin Qian (qian@ddn.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/33711&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/33711&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11695&quot; title=&quot;disabling the xattr cache on client for LSOM&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11695&quot;&gt;&lt;del&gt;LU-11695&lt;/del&gt;&lt;/a&gt; som: disabling xattr cache for LSOM on client&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 6fe19dcc84106eddfa6616d411b58e516cbaaaf2&lt;/p&gt;</comment>
                            <comment id="237410" author="adilger" created="Fri, 23 Nov 2018 11:03:03 +0000"  >&lt;p&gt;As I mentioned previously, there is no need to disable the xattr cache for &lt;tt&gt;trusted.som&lt;/tt&gt; completely.  Virtually all files in the filesystem will not be recently modified, so disabling the cache just means more overhead for the common case where the &lt;tt&gt;trusted.som&lt;/tt&gt; xattr is valid.  Also, the current implementation of LSOM is mainly intended to be used from the MDS by scanning the MDT disk filesystem directly, not to be used on the client, so adding overhead on the client to manage what is supposed to be &quot;lazy&quot; doesn&apos;t make sense. &lt;/p&gt;

&lt;p&gt;Even if the &lt;tt&gt;trusted.som&lt;/tt&gt; xattr is fetched repeatedly, there is still a chance that it is out-of-date (e.g. file has not been closed, &lt;tt&gt;llsom_sync&lt;/tt&gt; is not running, or MDS is an older version without LSOM), so we can&apos;t ever rely on it to be completely accurate, and shouldn&apos;t try too hard to make it so.  The file size will normally be accurate shortly after close, it is only the blocks count which may be inaccurate.  If the application depends on the blocks count to be relatively accurate, then the userspace application should check something like:&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;
        struct lustre_som_attrs lsom;

        rc = lgetxattr(file, &lt;span class=&quot;code-quote&quot;&gt;&quot;trusted.som&quot;&lt;/span&gt;, &amp;amp;lsom, sizeof(lsom));
        size = lsom.lsa_size;
        blocks = lsom.lsa_blocks;  &lt;span class=&quot;code-comment&quot;&gt;/* what unit is &lt;span class=&quot;code-quote&quot;&gt;&quot;lsa_blocks&quot;&lt;/span&gt; in? it should be documented */&lt;/span&gt;

        &lt;span class=&quot;code-comment&quot;&gt;/* &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; xattr fetch failed or is &lt;span class=&quot;code-object&quot;&gt;short&lt;/span&gt;, or &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; we care about blocks being relatively accurate */&lt;/span&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (rc &amp;lt; sizeof(lsom) || size &amp;gt; 1048576 &amp;amp;&amp;amp; lsom.lsa_blocks == 0 &amp;amp;&amp;amp; lsom.lsa_valid != SOM_FL_STRICT) {
                &lt;span class=&quot;code-comment&quot;&gt;/* LSOM data is likely stale (unless file is totally empty) */&lt;/span&gt;
                fd = open(file, O_RDONLY);
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (fd &amp;gt;= 0) {
                        rc = fstat(fd, st);
                        size = st.st_size;
                        blocks = st.st_blocks;

                        &lt;span class=&quot;code-comment&quot;&gt;/* closing the file will update the LSOM data &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; next time */&lt;/span&gt;
                        close(fd);  
                }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Two lighter-weight solutions exist that will still allow accurate &lt;tt&gt;trusted.som&lt;/tt&gt; xattrs to be fetched to the client:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;cancel the mdc DLM locks via &lt;tt&gt;lctl set_param ldlm.namespaces.&lt;b&gt;mdc&lt;/b&gt;.lru_size=clear&lt;/tt&gt; to discard all locks.  This is enough for testing that LSOM works, which is (IMHO) mostly what the &quot;&lt;tt&gt;lfs getsom&lt;/tt&gt;&quot; interface is for.  I don&apos;t think that applications will be using &quot;&lt;tt&gt;lfs getsom&lt;/tt&gt;&quot; or the &lt;tt&gt;trusted.som&lt;/tt&gt; xattr directly, and it isn&apos;t needed for the &lt;tt&gt;lfs find&lt;/tt&gt; or &lt;tt&gt;statx()&lt;/tt&gt; interface in the future.  Note that &lt;tt&gt;trusted.som&lt;/tt&gt; is only accessible to the root user, so this makes it not very useful for regular users, and a much better reason to implement &lt;tt&gt;statx()&lt;/tt&gt; for regular users instead of trying to guess.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;implement a heuristic on the client to re-fetch the &lt;tt&gt;trusted.som&lt;/tt&gt; xattr if the mtime/ctime of the inode is within the past e.g. 15 minutes (longer than what &lt;tt&gt;llsom_sync&lt;/tt&gt; needs to update &lt;tt&gt;trusted.som&lt;/tt&gt;, but use it from cache if the inode is older than this.  The MDS will already keep the inode up-to-date for the mtime/ctime (which is needed for POSIX), and if &lt;tt&gt;llsom_sync&lt;/tt&gt; hasn&apos;t update &lt;tt&gt;trusted.som&lt;/tt&gt; in this time, then it is likely that it is not running and LSOM will not be more uptodate than what the client has.  This will allow 99.999999% of (not-just-created) files to have the &lt;tt&gt;trusted.som&lt;/tt&gt; xattr fetched on lookup and cached on the client, rather than making each access generate another RPC (which could as well get the accurate file size directly from the OSTs).&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="237435" author="lixi_wc" created="Mon, 26 Nov 2018 06:58:10 +0000"  >&lt;p&gt;I think at least currently, there is no requirement to use the client side interface to acess the LSOM. So, I&apos;d suggest to delay the implement of this API until we started to see some real requirement for it. After all, LSOM is designed for MDT scanning, not client side accessment. And I think Yingjin&apos;s patch is enough to fix the test problem for now.&lt;/p&gt;</comment>
                            <comment id="270320" author="adilger" created="Fri, 15 May 2020 14:35:55 +0000"  >&lt;p&gt;Now that the statx() patch is landing, I think this patch should be abandoned, and this ticket closed.  &lt;/p&gt;</comment>
                            <comment id="328656" author="adilger" created="Wed, 9 Mar 2022 20:34:43 +0000"  >&lt;p&gt;It turns out that the &lt;tt&gt;trusted.som&lt;/tt&gt; xattr is not used directly on the client for anything except &quot;&lt;tt&gt;lfs getsom&lt;/tt&gt;&quot;, so keeping it in the xattr cache doesn&apos;t help any real workload, and only serves to confuse tests that are using &lt;tt&gt;getsom&lt;/tt&gt; and see a cached value that is stale.&lt;/p&gt;

&lt;p&gt;I&apos;ve un-abandoned patch &lt;a href=&quot;https://review.whamcloud.com/33711&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/33711&lt;/a&gt; &quot;&lt;tt&gt;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11695&quot; title=&quot;disabling the xattr cache on client for LSOM&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11695&quot;&gt;&lt;del&gt;LU-11695&lt;/del&gt;&lt;/a&gt; som: disabling xattr cache for LSOM on client&lt;/tt&gt;&quot;, but it will need to be rebased to resolve conflicts.&lt;/p&gt;</comment>
                            <comment id="340004" author="gerrit" created="Mon, 11 Jul 2022 06:48:55 +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/33711/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/33711/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11695&quot; title=&quot;disabling the xattr cache on client for LSOM&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11695&quot;&gt;&lt;del&gt;LU-11695&lt;/del&gt;&lt;/a&gt; som: disabling xattr cache for LSOM on client&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 192902851d73ec246af92a2ff7be8f23b08c4343&lt;/p&gt;</comment>
                            <comment id="340041" author="pjones" created="Mon, 11 Jul 2022 12:56:27 +0000"  >&lt;p&gt;Landed for 2.16&lt;/p&gt;</comment>
                            <comment id="362234" author="gerrit" created="Thu, 9 Feb 2023 02:56:52 +0000"  >&lt;p&gt;&quot;Jian Yu &amp;lt;yujian@whamcloud.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/49952&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/49952&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11695&quot; title=&quot;disabling the xattr cache on client for LSOM&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11695&quot;&gt;&lt;del&gt;LU-11695&lt;/del&gt;&lt;/a&gt; som: disabling xattr cache for LSOM on client&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_15&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: e32b3e958a1210c8b082668a7afc936c3e5f16fe&lt;/p&gt;</comment>
                            <comment id="367500" author="gerrit" created="Tue, 28 Mar 2023 07:09:35 +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/c/fs/lustre-release/+/49952/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/49952/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11695&quot; title=&quot;disabling the xattr cache on client for LSOM&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11695&quot;&gt;&lt;del&gt;LU-11695&lt;/del&gt;&lt;/a&gt; som: disabling xattr cache for LSOM on client&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_15&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: dcd842e870a099e18a9afcb817f382648c96bed0&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="67911">LU-15431</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="68916">LU-15609</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="68848">LU-15593</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="55729">LU-12332</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </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_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i006t3:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>