<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:29: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-2919] Exclusive open implementation</title>
                <link>https://jira.whamcloud.com/browse/LU-2919</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Proposed way to do exclusive open:&lt;/p&gt;

&lt;p&gt;0. First of all, we have to perform most of the work in kernel space;&lt;br/&gt;
1. Client exclusively opens the file with IT_RELEASE_OPEN.&lt;br/&gt;
  1.1 exclusive open means the open will fail if the file is being opened by somebody else;&lt;/p&gt;

&lt;p&gt;2. the MDT will handle IT_RELEASE as follows:&lt;br/&gt;
  2.1 Revoke OPEN_LOCK on this file, just request EX mode of MDS_INODELOCK_OPEN lock and release it;&lt;br/&gt;
  2.2 Acquire a rwsem, say open_rwsem, with write mode before trying to the file; for the normal open, it should acquire read mode of open_rwsem;&lt;br/&gt;
  2.3 Check if the file is already being opened by others, if not return with -EBUSY;&lt;br/&gt;
  2.4 Check if the file can be released;&lt;br/&gt;
  2.5 Set a special flag in struct mdt_file_data to mark this open is exclusive;&lt;br/&gt;
  2.5 Release open rwsem.&lt;/p&gt;

&lt;p&gt;From now on, if the file is opened by others, it will mark mdt_file_data that the exclusive open is broken.&lt;/p&gt;

&lt;p&gt;3. Client: if IT_RELEASE_OPEN is finished successfully, and do followings:&lt;br/&gt;
  3.1 Acquire full PW or EX extent lock to flush dirty cache;&lt;br/&gt;
  3.2 Pack the handle of layout lock, data version and other attars;&lt;br/&gt;
  3.3 Close the file with IT_RELEASE_CLOSE.&lt;/p&gt;

&lt;p&gt;4. Back to MDT to handle IT_RELEASE CLOSE: &lt;br/&gt;
  4.1 Grab the open_rwsem &lt;br/&gt;
  4.2 Check if the exclusive open has ever been broken, in that case, the RELEASE process will fail;&lt;br/&gt;
  4.3 Verify the data version matches archive;&lt;br/&gt;
  4.4 Grab EX layout lock&lt;br/&gt;
  4.5 Swap the layout&lt;br/&gt;
  4.6 Release EX layout lock&lt;br/&gt;
  4.7 Close the exclusive open&lt;/p&gt;

&lt;p&gt;Basically we avoid granting EX layout lock back to client and introduce exclusive open so that we know it if the file has ever being accessed. I hope this can simplify things a little bit. Also, exclusive open can be used to implement file lease.&lt;/p&gt;

&lt;p&gt;And a bugfix for recovery:&lt;/p&gt;

&lt;p&gt;I&apos;d like to update the special handling of replaying exclusive open request.&lt;/p&gt;

&lt;p&gt;There is a bug in current mode as follows:&lt;br/&gt;
1. Client 1 does exclusive open&lt;br/&gt;
2. Client 2 does open and close, so it will break the exclusive open above&lt;br/&gt;
3. MDT crashes and restarts&lt;br/&gt;
4. Client 1 replays exclusive open request and will lose the information that it has already been broken&lt;/p&gt;

&lt;p&gt;The root cause of this bug is that we don&apos;t store the exclusive open bit in persistent storage so we can&apos;t get it back over recovery.&lt;/p&gt;

&lt;p&gt;The fix is to check on the MDT side whenever the exclusive open is being replayed, it will be marked as broken all the time.&lt;/p&gt;</description>
                <environment></environment>
        <key id="17780">LU-2919</key>
            <summary>Exclusive open implementation</summary>
                <type id="7" iconUrl="https://jira.whamcloud.com/images/icons/issuetypes/task_agile.png">Technical task</type>
                            <parent id="16875">LU-2445</parent>
                                    <priority id="2" iconUrl="https://jira.whamcloud.com/images/icons/priorities/critical.svg">Critical</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="jay">Jinshan Xiong</assignee>
                                    <reporter username="jay">Jinshan Xiong</reporter>
                        <labels>
                            <label>HSM</label>
                    </labels>
                <created>Wed, 6 Mar 2013 11:23:19 +0000</created>
                <updated>Tue, 20 Aug 2013 18:17:38 +0000</updated>
                            <resolved>Tue, 20 Aug 2013 18:17:38 +0000</resolved>
                                    <version>Lustre 2.5.0</version>
                                    <fixVersion>Lustre 2.5.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>9</watches>
                                                                            <comments>
                            <comment id="55616" author="adegremont" created="Fri, 5 Apr 2013 16:51:14 +0000"  >&lt;p&gt;As Johann suggested, I&apos;ve push a prototype of this patch, extract from my work on Release patch.&lt;br/&gt;
We know this patch is not perfect, but Johann thought it could useful for Jinshan.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://review.whamcloud.com/5956&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/5956&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="61043" author="jay" created="Fri, 21 Jun 2013 21:39:14 +0000"  >&lt;p&gt;Another implementation is at &lt;a href=&quot;http://review.whamcloud.com/6730&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/6730&lt;/a&gt; which is framework of lustre file lease but right now only excl open is supported.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="19879">LU-3608</issuekey>
        </issuelink>
                            </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|hzvkb3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7016</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>