<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:49:52 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-12125] Allow parallel rename of regular files</title>
                <link>https://jira.whamcloud.com/browse/LU-12125</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In theory it should be possible to relax renaming rules and allow parallel renaming of regular (or non-directory) files. &lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;the easiest and most common case would be rename of files within the same parent directory, like &quot;&lt;tt&gt;mv foo foo.old&lt;/tt&gt;&quot; where we would only need to lock the DLM resources of the source and target name hashes&lt;/li&gt;
	&lt;li&gt;the next case would be to allow rename of files between directories&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Probably the easiest is to order such locks by DLM resource (FID+hash) to avoid deadlocks between multiple threads doing renames. For directory renames, they still need to be serialized by the BFL and also take the name hash locks in the source and target dirs to avoid conflict with regular file renames. In theory it would also be possible to allow concurrent rename of directories within the same parent, but that could be done in a separate step. &lt;/p&gt;

&lt;p&gt;For renames across shards within a single DNE striped directory they would be treated as renames across directories. &lt;/p&gt;</description>
                <environment></environment>
        <key id="31766">LU-12125</key>
            <summary>Allow parallel rename of regular files</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="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="adilger">Andreas Dilger</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 Aug 2015 07:51:25 +0000</created>
                <updated>Tue, 16 Jan 2024 00:50:35 +0000</updated>
                            <resolved>Wed, 21 Apr 2021 04:04:17 +0000</resolved>
                                                    <fixVersion>Lustre 2.15.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>9</watches>
                                                                            <comments>
                            <comment id="125495" author="adilger" created="Fri, 28 Aug 2015 08:00:13 +0000"  >&lt;p&gt;Di, Lai, what do you think of this?&lt;/p&gt;

&lt;p&gt;How hard would this be to implement? A few lines of code to fix up the locking for regular files?  A bunch of code cleanup required first? A major feature to rewrite large parts of the MDS code?&lt;/p&gt;

&lt;p&gt;In some sense the rename of a regular file could be treated the same as the creation of a file in the target dir and deletion of the file from the source dir, so pdirop locking within the directory would be enough, unlike rename of directories which need full tree locks to avoid creating loops or orphan trees. &lt;/p&gt;</comment>
                            <comment id="125572" author="di.wang" created="Fri, 28 Aug 2015 17:58:42 +0000"  >&lt;p&gt;Yes, file rename under the same parent should be easy to implement, (only need fix mdt_rename_lock and order locks of source and target). Hmm, even rename files between directories might be easy to fix, probably we only need consider to order locks of the source and target parents, though with current implementation, we need check the parent/child relationship to order the locks, which will probably still need BFL lock unless we can order the locks by FID + hash, but then we will need change the order of locks everywhere (i.e. from parent-child to FID+hash order), which probably need some time to implement.&lt;/p&gt;

&lt;p&gt;As you said, directories rename might not be easy, unless we have subtree lock or similar thing.&lt;/p&gt;

&lt;p&gt;There are still a few simply fixes we can do&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;rename lock can be released early in some cases, maybe after we get LDLM locks, though I am not sure if we can do that for directories rename.&lt;/li&gt;
	&lt;li&gt;For DNE, there can be BFL locks on each MDT, we probably only needs to enqueue BFL locks on MDTs where source and target parent locate.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="254143" author="adilger" created="Thu, 5 Sep 2019 00:05:01 +0000"  >&lt;p&gt;This might also need the patch &lt;a href=&quot;https://review.whamcloud.com/14375&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/14375&lt;/a&gt; &quot;&lt;tt&gt;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6864&quot; title=&quot;DNE3: Support multiple modify RPCs in flight for MDT-MDT connection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6864&quot;&gt;&lt;del&gt;LU-6864&lt;/del&gt;&lt;/a&gt; osp: manage number of modify RPCs in flight&lt;/tt&gt;&quot; to allow multiple OUT RPCs in flight at one time when renaming between shards of striped directories or across MDTs.&lt;/p&gt;</comment>
                            <comment id="289116" author="gerrit" created="Sat, 9 Jan 2021 07:35:26 +0000"  >&lt;p&gt;Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/41184&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/41184&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12125&quot; title=&quot;Allow parallel rename of regular files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12125&quot;&gt;&lt;del&gt;LU-12125&lt;/del&gt;&lt;/a&gt; llite: send file mode with rename RPC&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: d7eb3ea257299e5942a8aac77d98ddb6132f2014&lt;/p&gt;</comment>
                            <comment id="289117" author="adilger" created="Sat, 9 Jan 2021 07:38:15 +0000"  >&lt;p&gt;Lai, do you have a chance to look into this to see how hard it would be to handle same-dir renames (for striped directories only if source and target stripe are the same parent FID) with just a lock on the parent FID?  Given that we don&apos;t really support interop between different MDS versions, there isn&apos;t much concern for protocol interoperability.&lt;/p&gt;

&lt;p&gt;We &lt;em&gt;might&lt;/em&gt; consider an &lt;tt&gt;OBD_CONNECT2_RENAME&lt;/tt&gt; flag to ensure that all of the MDTs have support for this, but even that may not be necessary.  At worst, if any of the other MDTs don&apos;t support same-dir renames they will still request the &lt;tt&gt;LUSTRE_BFL_FID&lt;/tt&gt; lock from MDT0000 before getting the parent FID locks, which is sub-optimal but is not problematic.  Since the same-dir rename will also lock the parent FID, if other MDSes allow this but MDT0000 does not, then at worst the same-dir rename will only be blocked on the directory lock and not &lt;tt&gt;LUSTRE_BFL_FID&lt;/tt&gt;, but this does not affect correctness since there is no lock ordering problem when only renaming regular files.&lt;/p&gt;

&lt;p&gt;It may be that all is needed is to skip the call to &lt;tt&gt;mdt_rename_lock()&lt;/tt&gt; call if &lt;tt&gt;msrcdir == mtgtdir&lt;/tt&gt; and the renamed object is a regular file.  If the client sends the file type with the rename RPC then this is relatively easily done.  Unfortunately, that is not the case today:&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; ll_rename(struct inode *src, struct dentry *src_dchild,
                     struct inode *tgt, struct dentry *tgt_dchild)
{
        :
        op_data = ll_prep_md_op_data(NULL, src, tgt, NULL, 0, mode=0,
                                     LUSTRE_OPC_ANY, NULL);


struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
                                      struct inode *i1, struct inode *i2,
                                      &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *name, size_t namelen,
                                      __u32 mode, &lt;span class=&quot;code-keyword&quot;&gt;enum&lt;/span&gt; md_op_code opc,
                                      void *data)
{
        :
        op_data-&amp;gt;op_mode = mode;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;ve pushed a simple patch to send the file mode along with the rename RPC so that the locking decision can be made easily on the MDS.  Hopefully this can be included into 2.14 before it is released.&lt;/p&gt;</comment>
                            <comment id="289120" author="gerrit" created="Sat, 9 Jan 2021 10:33:46 +0000"  >&lt;p&gt;Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/41186&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/41186&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12125&quot; title=&quot;Allow parallel rename of regular files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12125&quot;&gt;&lt;del&gt;LU-12125&lt;/del&gt;&lt;/a&gt; mds: allow parallel regular file rename&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: bc1e773b4364dde14df17645dd4d27b1143d1ccf&lt;/p&gt;</comment>
                            <comment id="289548" author="gerrit" created="Fri, 15 Jan 2021 00:08:06 +0000"  >&lt;p&gt;Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/41229&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/41229&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12125&quot; title=&quot;Allow parallel rename of regular files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12125&quot;&gt;&lt;del&gt;LU-12125&lt;/del&gt;&lt;/a&gt; mds: allow parallel directory rename&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 8ba0a64c75dbc69bf9de774b67a7e49419f3ba7d&lt;/p&gt;</comment>
                            <comment id="289549" author="gerrit" created="Fri, 15 Jan 2021 00:10:12 +0000"  >&lt;p&gt;Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/41230&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/41230&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12125&quot; title=&quot;Allow parallel rename of regular files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12125&quot;&gt;&lt;del&gt;LU-12125&lt;/del&gt;&lt;/a&gt; mds: allow parallel directory rename&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 8f50962fb02463d620163f9444a430ceca693368&lt;/p&gt;</comment>
                            <comment id="289553" author="gerrit" created="Fri, 15 Jan 2021 01:24:53 +0000"  >&lt;p&gt;Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/41231&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/41231&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12125&quot; title=&quot;Allow parallel rename of regular files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12125&quot;&gt;&lt;del&gt;LU-12125&lt;/del&gt;&lt;/a&gt; tests: allow racer to specify extra tasks&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 4a12916a0375d97fa67bdcdcf860fcf9b88f4192&lt;/p&gt;</comment>
                            <comment id="290163" author="gerrit" created="Fri, 22 Jan 2021 20:14:25 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/41184/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/41184/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12125&quot; title=&quot;Allow parallel rename of regular files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12125&quot;&gt;&lt;del&gt;LU-12125&lt;/del&gt;&lt;/a&gt; llite: send file mode with rename RPC&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 47576dc68cd90068cd5cbd5c889f04531fe6e682&lt;/p&gt;</comment>
                            <comment id="291561" author="adilger" created="Tue, 9 Feb 2021 22:34:18 +0000"  >&lt;p&gt;Further improvements in this area beyond the patches already pushed for same-dir rename operations:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;instead of locking whole parent directory, just lock parent FID+source/target hash to allow parallel file (or directory) rename within a single directory&lt;/li&gt;
	&lt;li&gt;allow rename between shards of a striped directory, given that we know source and target shards are not child/ancestor of each other (though there would still need to ordering for locking of individual shards)&lt;/li&gt;
	&lt;li&gt;allow regular file rename between different source/target directories, which will need to get a fixed locking order to avoid deadlocks.  That code already exists, so may be &quot;only&quot; a matter of dropping the BFL once the source/target are locked.  With only regular file rename, there is no strong requirement to know the parent/child relationship of the parent directories, but the consistent locking order is still required to avoid AB/BA deadlocks with other concurrent operations.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I think the benefit of allowing arbitrary parallel directory rename is pretty small, and probably not worthwhile pursuing in the context of this ticket.&lt;/p&gt;</comment>
                            <comment id="294146" author="gerrit" created="Sat, 6 Mar 2021 02:35:23 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/41186/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/41186/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12125&quot; title=&quot;Allow parallel rename of regular files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12125&quot;&gt;&lt;del&gt;LU-12125&lt;/del&gt;&lt;/a&gt; mds: allow parallel regular file rename&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: d76cc65d5d68ed3e04bfbd9b7527f64ab0ee0ca7&lt;/p&gt;</comment>
                            <comment id="299354" author="gerrit" created="Wed, 21 Apr 2021 03:15:12 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/41230/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/41230/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12125&quot; title=&quot;Allow parallel rename of regular files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12125&quot;&gt;&lt;del&gt;LU-12125&lt;/del&gt;&lt;/a&gt; mds: allow parallel directory rename&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 90979ab390a72a084f6a77cf7fdc29a4329adb41&lt;/p&gt;</comment>
                            <comment id="299355" author="gerrit" created="Wed, 21 Apr 2021 03:15:17 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/41231/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/41231/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12125&quot; title=&quot;Allow parallel rename of regular files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12125&quot;&gt;&lt;del&gt;LU-12125&lt;/del&gt;&lt;/a&gt; tests: allow racer to specify extra tasks&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: fe2663f18e50023ad5cfe5e07b695378dd27a68e&lt;/p&gt;</comment>
                            <comment id="299368" author="pjones" created="Wed, 21 Apr 2021 04:04:17 +0000"  >&lt;p&gt;Looks like everything has landed for 2.15&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="55041">LU-12037</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="31120">LU-6864</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="70637">LU-15913</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="67360">LU-15285</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="80013">LU-17426</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|hzxlk7:</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>