<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:09:22 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-7493] Mess of atime of OST objects</title>
                <link>https://jira.whamcloud.com/browse/LU-7493</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;I am not sure whether it is a feature or not (maybe not). But currently there are some problems of timestamps on OST. &lt;/p&gt;

&lt;p&gt;1) If use &#8216;lfs setstripe&#8217; to create a file, the OST object(s) won&apos;t have any atime/ctime/mtime&lt;br/&gt;
2) Writing to an OST object will update atime to zero. However, atime should only be updated when reading the file. And, the value of atime shouldn&apos;t  be updated to zero in any sense.&lt;br/&gt;
3) Reading an OST doesn&apos;t update the atime.&lt;/p&gt;

&lt;p&gt;So, is there any special reason of these behaviors? I understand it won&apos;t cause any problem to the POSIX semantics on Lustre client. And we can even avoid performance degredation by using noatime on OST. But we need to make sure everything is behaving in the way that we expect.&lt;/p&gt;</description>
                <environment></environment>
        <key id="33363">LU-7493</key>
            <summary>Mess of atime of OST objects</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="6" iconUrl="https://jira.whamcloud.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="6">Not a Bug</resolution>
                                        <assignee username="lixi_wc">Li Xi</assignee>
                                    <reporter username="lixi">Li Xi</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Nov 2015 15:38:40 +0000</created>
                <updated>Fri, 17 Aug 2018 00:47:54 +0000</updated>
                            <resolved>Fri, 17 Aug 2018 00:47:54 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="134654" author="adilger" created="Fri, 27 Nov 2015 17:54:15 +0000"  >&lt;p&gt;The atime handling on OSTs is intended to avoid overhead during reads. The initial timestamp on the OST objects is set so that it will always be updated by any real timestamp from the client, and so that the inode timestamp on the MDT is newer unless the OST object was updated after creation, so setting the OST atime to zero is not harmful - the client will use the newer MDT inode atime instead. .&lt;/p&gt;

&lt;p&gt;The OST object atime is updated in memory during each read, so that if one client reads the file and then another client stats the file it will have the correct atime. The atime update on the OST will &lt;b&gt;not&lt;/b&gt; update the inode on disk unless the inode is modified again for some other reason, and it will &lt;b&gt;not&lt;/b&gt; revoke the locks held by clients, so any atime fetched by a client will be cached by that client until it loses its lock on the object. &lt;/p&gt;

&lt;p&gt;The atime is written to disk only on the MDS when the file is closed, and only if it is (by default) more than 60s out of date (this can be tuned in /proc). That avoids thousands of atime updates when many clients close the same file. In combination with the OSS in memory cache of atime, clients will typically see the correct atime, and it will be saved to disk on file close, unless all the clients reading the file crash or are evicted. &lt;/p&gt;

&lt;p&gt;Is there a specific problem you are seeing with atime on the clients, or is this only a question about how atime works? It might be useful if you could put the above in a comment, maybe near the OST atime updates so that it is available for other developers. &lt;/p&gt;</comment>
                            <comment id="134655" author="adilger" created="Fri, 27 Nov 2015 17:56:57 +0000"  >&lt;p&gt;To clarify your comment about writes updating the atime to zero - is that only on the first write, or does that always happen for any write? That probably is not correct if it happens on every write. Either the o_atime should contain valid atime, or the OBD_MD_FLATIME flag should not be set. &lt;/p&gt;</comment>
                            <comment id="134665" author="lixi" created="Sat, 28 Nov 2015 04:57:58 +0000"  >&lt;p&gt;Hi Andreas,&lt;/p&gt;

&lt;p&gt;Thank you very much for the explanation. I might need some time to read it through.&lt;/p&gt;

&lt;p&gt;I am interested in atime on OST because I am implementing a policy engine on OST side for cache. And as you can image, atime could be a useful attribute to determine to prefetch an object to cache or not. So, at least, I need to understand what is the expected behavior of atime.&lt;/p&gt;

&lt;p&gt;Following is the result that I got from ofd_attr_get(). Can I say all the behaviors are all expected? It seems atime on OST is not updated after read. So, which way should I use to get the cached atime in memory, please?&lt;/p&gt;

&lt;p&gt;Timestamps after using &quot;lfs setstripe&quot; to generate a empty file&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=atime &lt;br/&gt;
Result: 0&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=mtime &lt;br/&gt;
Result: 0&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=ctime &lt;br/&gt;
Result: 0&lt;br/&gt;
Timestamps after &quot;sleep 3 &amp;amp;&amp;amp; dd if=/dev/zero of=FILE bs=1048576 count=10 &amp;amp;&amp;amp; sync&quot;&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=atime &lt;br/&gt;
Result: 0&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=mtime &lt;br/&gt;
Result: 1448645957&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=ctime &lt;br/&gt;
Result: 1448645957&lt;br/&gt;
Timestamps after &quot;sleep 3 &amp;amp;&amp;amp; dd if=FILE bs=/dev/null of=FILE bs=1048576 &quot; again&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=atime &lt;br/&gt;
Result: 0&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=mtime &lt;br/&gt;
Result: 1448645957&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=ctime &lt;br/&gt;
Result: 1448645957&lt;br/&gt;
Timestamps after &quot;sleep 3 &amp;amp;&amp;amp; touch&quot;&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=atime &lt;br/&gt;
Result: 1448645964&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=mtime &lt;br/&gt;
Result: 1448645964&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=ctime &lt;br/&gt;
Result: 1448645964&lt;br/&gt;
Timestamps after &quot;sleep 3 &amp;amp;&amp;amp; dd if=/dev/zero of=FILE bs=1048576 count=10 &amp;amp;&amp;amp; sync&quot; again&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=atime &lt;br/&gt;
Result: 1448645964&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=mtime &lt;br/&gt;
Result: 1448645967&lt;br/&gt;
obdfilter.ofd_cache.prefetch_rule=ctime &lt;br/&gt;
Result: 1448645967&lt;/p&gt;</comment>
                            <comment id="134666" author="lixi" created="Sat, 28 Nov 2015 05:02:18 +0000"  >&lt;p&gt;And sorry,&lt;/p&gt;

&lt;p&gt;ofd_commitrw_write() does NOT update the atime to zero according to the results. I was surprised that LA_ATIME was not filtered in ofd_commitrw_write() because write should NOT change atime.&lt;/p&gt;</comment>
                            <comment id="134762" author="adilger" created="Mon, 30 Nov 2015 18:19:58 +0000"  >&lt;p&gt;The write should update the atime if it is updated from a previous read, since the read itself won&apos;t update atime on disk. &lt;/p&gt;

&lt;p&gt;Can you check that the read RPC is properly sending the atime from the client and setting &lt;tt&gt;OBD_MD_FLATIME&lt;/tt&gt;. Otherwise it can&apos;t do anything. &lt;/p&gt;</comment>
                            <comment id="232098" author="lixi_wc" created="Fri, 17 Aug 2018 00:47:42 +0000"  >&lt;p&gt;I am closing this ticket since I feel this might not be a problem. Thanks!&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_10490" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>End date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 30 Nov 2015 15:38:40 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzxufr:</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>
                                                                                                                        <customfield id="customfield_10493" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>Start date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 27 Nov 2015 15:38:40 +0000</customfieldvalue>

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