<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:05:35 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-13951] How to get the timestamp of a file data_version&apos;s last change</title>
                <link>https://jira.whamcloud.com/browse/LU-13951</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Hello! On Fir storage, we&apos;re tracking time when a file&apos;s content was last modified. Not the mtime, but the effective time when the file&apos;s content had changed. Indeed, we prefer not to rely on the file&apos;s mtime which is easily modified by touch.&lt;/p&gt;

&lt;p&gt;To mitigate this, we currently record files&apos; data_version in Robinhood DB along with a timestamp (max of ctime and mtime). Our purge policy is based on data_version, and if it hasn&apos;t changed for 3 months, that means the content has not changed and we purge the file. While this solution works for us, it&apos;s not lightweight and it would be easier for us if Lustre could make the last time data_version was updated in Lustre accessible via the liblustreapi.&lt;/p&gt;

&lt;p&gt;I don&apos;t know how difficult it would be to implement this feature, but this is something that could be useful. Thanks!&lt;/p&gt;</description>
                <environment>CentOS 7.6</environment>
        <key id="60695">LU-13951</key>
            <summary>How to get the timestamp of a file data_version&apos;s last change</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</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="pjones">Peter Jones</assignee>
                                    <reporter username="sthiell">Stephane Thiell</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Sep 2020 22:13:14 +0000</created>
                <updated>Tue, 8 Sep 2020 16:00:40 +0000</updated>
                                            <version>Lustre 2.12.5</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="279019" author="adilger" created="Tue, 8 Sep 2020 15:26:07 +0000"  >&lt;p&gt;Hi Stephane, I was thinking about how this might be achieved without adding too much overhead. My understanding is that the concern is primarily about &quot;touch&quot; moving the timestamp forward without actually modifying the file data, and the overhead relates to &lt;b&gt;storing&lt;/b&gt; the &lt;tt&gt;data_version&lt;/tt&gt; value in RBH? Otherwise, if the &lt;tt&gt;data_version&lt;/tt&gt; is stored in RBH, and checked periodically (e.g. at most once a day) when files appear in the Changelog, it isn&apos;t clear that storing a separate timestamp in Lustre just for this purpose.&lt;/p&gt;

&lt;p&gt;One idea that I had was that if &quot;touch&quot; is moving the mtime &lt;em&gt;forward&lt;/em&gt;, then this could be stored only on the MDT (which is enough that &quot;&lt;tt&gt;stat()&lt;/tt&gt;&quot; will return the correct value), and the OST mtimes do not need to be updated in the setattr case. For mtimes being moved &lt;em&gt;backward&lt;/em&gt; the OST mtimes also need to be updated, but I don&apos;t think that is a concern. This would allow the OST object mtimes to be used as an actual &quot;last data modified&quot; time, if there was an interface to return those timestamps to userspace on the client.&lt;/p&gt;

&lt;p&gt;For the userspace interface, there is already &lt;tt&gt;IOC_MDC_GETFILEINFO&lt;/tt&gt; that retrieves the layout and the &lt;tt&gt;stat&lt;/tt&gt; (or &lt;tt&gt;statx&lt;/tt&gt;) data, but the kernel side specifically &lt;b&gt;avoids&lt;/b&gt; getting attributes from the OSTs if it can, to minimize overhead. Having a companion interface that &lt;b&gt;only&lt;/b&gt; gets the OST attributes would be possible, possibly as a companion/extension of &lt;tt&gt;LL_IOC_DATA_VERSION&lt;/tt&gt; would be possible. This ioctl is declared properly:&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;enum&lt;/span&gt; ioc_data_version_flags {
        LL_DV_RD_FLUSH  = (1 &amp;lt;&amp;lt; 0), &lt;span class=&quot;code-comment&quot;&gt;/* Flush dirty pages from clients */&lt;/span&gt;
        LL_DV_WR_FLUSH  = (1 &amp;lt;&amp;lt; 1), &lt;span class=&quot;code-comment&quot;&gt;/* Flush all caching pages from clients */&lt;/span&gt;
        LL_DV_TIMESTAMP = (1 &amp;lt;&amp;lt; 2), &lt;span class=&quot;code-comment&quot;&gt;/* Last data_version update time */&lt;/span&gt;
};

struct ioc_data_version {
        __u64   idv_version;
        __u32   idv_layout_version; &lt;span class=&quot;code-comment&quot;&gt;/* FLR: layout version &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; OST objects */&lt;/span&gt;
        __u32   idv_flags;          &lt;span class=&quot;code-comment&quot;&gt;/* &lt;span class=&quot;code-keyword&quot;&gt;enum&lt;/span&gt; ioc_data_version_flags */&lt;/span&gt;
};
#define LL_IOC_DATA_VERSION             _IOR(&lt;span class=&quot;code-quote&quot;&gt;&apos;f&apos;&lt;/span&gt;, 218, struct ioc_data_version)

struct ioc_data_version_v2 {
        __u64   idv_version;
        __u32   idv_layout_version; &lt;span class=&quot;code-comment&quot;&gt;/* FLR: layout version &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; OST objects */&lt;/span&gt;
        __u32   idv_flags;          &lt;span class=&quot;code-comment&quot;&gt;/* &lt;span class=&quot;code-keyword&quot;&gt;enum&lt;/span&gt; ioc_data_version_flags */&lt;/span&gt;
        __u64   idv_timestamp;      &lt;span class=&quot;code-comment&quot;&gt;/* last data_version modification time */&lt;/span&gt;
};
#define LL_IOC_DATA_VERSION_V2          _IOR(&lt;span class=&quot;code-quote&quot;&gt;&apos;f&apos;&lt;/span&gt;, 218, struct ioc_data_version_v2)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;in that if the size of &lt;tt&gt;struct ioc_data_version&lt;/tt&gt; is increased to include a &lt;tt&gt;__u64 idv_timestamp&lt;/tt&gt; then it would introduce a new ioctl number (&quot;version&quot;) for &lt;tt&gt;LL_IOC_DATA_VERSION_V2&lt;/tt&gt; that could be used for compatibility/interop detection and fallback. There could also be a new &lt;tt&gt;LL_DV_TIMESTAMP&lt;/tt&gt; flag to indicate whether the timestamp is requested or not.&lt;/p&gt;

&lt;p&gt;Note that this mechanism wouldn&apos;t work for DoM files, because there is not a separate mtime stored for the MDT inode, unlike the OST inode mtime which could be used to only reflect the &quot;data&quot; timestamp.&lt;/p&gt;

&lt;p&gt;That said, I don&apos;t think there is anyone on our side that would be working on this in the near future, as we already have our hands full with other projects and the cutoff for 2.14 features has already behind us.&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|i01993:</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>