<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:05:15 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-7014] IAM index delete operation can require extra credits under certain situations</title>
                <link>https://jira.whamcloud.com/browse/LU-7014</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In testing the nodemap save config patch (&lt;a href=&quot;http://review.whamcloud.com/#/c/11813/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/11813/&lt;/a&gt;), I ran into a situation where I can consistently cause a kernel panic by creating a large number of index records, and then deleting them. The cause appears to be that under certain circumstances the delete operation requires more credits than are allocated. &lt;/p&gt;

&lt;p&gt;Here&apos;s the LBUG and jbd2 abort:&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;...
[ 5846.233511]  [&amp;lt;ffffffffa0c32572&amp;gt;] __ldiskfs_handle_dirty_metadata+0x1d2/0x230 [ldiskfs]
[ 5846.233613]  [&amp;lt;ffffffffa0418592&amp;gt;] ? jbd2_journal_get_write_access+0x32/0x40 [jbd2]
[ 5846.233724]  [&amp;lt;ffffffffa0d15aaa&amp;gt;] iam_txn_dirty+0x2a/0x60 [osd_ldiskfs]
[ 5846.233835]  [&amp;lt;ffffffffa0d18a63&amp;gt;] iam_it_rec_delete+0x4f3/0x6d0 [osd_ldiskfs]
[ 5846.233943]  [&amp;lt;ffffffffa0d191b4&amp;gt;] iam_delete+0x64/0xe0 [osd_ldiskfs]
[ 5846.234073]  [&amp;lt;ffffffffa0d070d7&amp;gt;] osd_index_iam_delete+0x227/0x6c0 [osd_ldiskfs]
[ 5846.234185]  [&amp;lt;ffffffffa0d19df0&amp;gt;] ? iam_lfix_split+0x140/0x140 [osd_ldiskfs]
[ 5846.234347]  [&amp;lt;ffffffffa089f572&amp;gt;] nodemap_idx_delete+0x2e2/0x4e0 [ptlrpc]
...
[ 5846.237738] LDISKFS-fs: iam_txn_dirty:606: aborting transaction: error 28 in __ldiskfs_handle_dirty_metadata
[ 5846.237837] LDISKFS: jbd2_journal_dirty_metadata failed: handle type 0 started at line 991, credits 2/0, errcode -28
[ 5846.237855] LDISKFS-fs error (device loop0) in iam_txn_dirty:608: error 28
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;[ 5846.243727] Lustre: 9062:0:(osd_iam.c:2410:iam_recycle_leaf()) test-MDT0000: idle blocks failed, will lose the blk 2
[ 5846.243799] Lustre: 9062:0:(osd_internal.h:1087:osd_trans_exec_check()) op 9: used 2, used now 2, reserved 1
[ 5846.243868] Lustre: 9062:0:(osd_handler.c:902:osd_trans_dump_creds())   create: 0/0/0, destroy: 0/0/0
[ 5846.243938] Lustre: 9062:0:(osd_handler.c:909:osd_trans_dump_creds())   attr_set: 0/0/0, xattr_set: 1/1/0
[ 5846.244028] Lustre: 9062:0:(osd_handler.c:919:osd_trans_dump_creds())   write: 0/0/0, punch: 0/0/0, quota 0/0/0
[ 5846.244096] Lustre: 9062:0:(osd_handler.c:926:osd_trans_dump_creds())   insert: 0/0/0, delete: 1/1/2
[ 5846.244165] Lustre: 9062:0:(osd_handler.c:933:osd_trans_dump_creds())   ref_add: 0/0/0, ref_del: 0/0/0
[ 5846.244243] LustreError: 9062:0:(osd_internal.h:1090:osd_trans_exec_check()) LBUG
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I also added some debugging code to iam_it_rec_delete to track credits of the form:&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;CDEBUG(D_INFO, &lt;span class=&quot;code-quote&quot;&gt;&quot;about to delete, credits: %d\n&quot;&lt;/span&gt;, h-&amp;gt;h_buffer_credits);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the sequence that caused the LBUG:&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;00000001:00000040:1.0:1439827725.734445:0:9062:0:(osd_iam.c:2443:iam_it_rec_delete()) about to delete, credits: 2
00000001:00000040:1.0:1439827725.734447:0:9062:0:(osd_iam.c:2445:iam_it_rec_delete()) about to dirty, credits: 2
00000001:00000040:1.0:1439827725.734449:0:9062:0:(osd_iam.c:2451:iam_it_rec_delete()) about to shrink, credits: 1                                                                                                              
00000001:00000040:1.0:1439827725.734453:0:9062:0:(osd_iam.c:2460:iam_it_rec_delete()) about to recycle, credits: 0                                                                                                                
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It looks like dirty, shrink , and recycle can each consume a credit, but don&apos;t always:&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;00000001:00000040:1.0:1439827725.620483:0:9002:0:(osd_iam.c:2443:iam_it_rec_delete()) about to delete, credits: 2
00000001:00000040:1.0:1439827725.620485:0:9002:0:(osd_iam.c:2445:iam_it_rec_delete()) about to dirty, credits: 2
00000001:00000040:1.0:1439827725.620486:0:9002:0:(osd_iam.c:2451:iam_it_rec_delete()) about to shrink, credits: 2
00000001:00000040:1.0:1439827725.620490:0:9002:0:(osd_iam.c:2460:iam_it_rec_delete()) about to recycle, credits: 2
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It seems like you could just modify &lt;tt&gt;osd_dto_credits_noquota[DTO_INDEX_DELETE]&lt;/tt&gt; to be 2 instead of 1, but I wasn&apos;t sure what the consequence of that would be. I also noticed that in &lt;tt&gt;osd_declare_object_destroy()&lt;/tt&gt;, there are extra credits taken for the recycle operation:&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;        /* Recycle idle OI leaf may cause additional three OI blocks                                                  
         * to be changed. */                                                                                          
        osd_trans_declare_op(env, oh, OSD_OT_DELETE,                                                                  
                             osd_dto_credits_noquota[DTO_INDEX_DELETE] + 3);                                          
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Anyway, I wasn&apos;t sure what the best way to proceed is and was hoping for some insight. Thanks.&lt;/p&gt;</description>
                <environment></environment>
        <key id="31506">LU-7014</key>
            <summary>IAM index delete operation can require extra credits under certain situations</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="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="kit.westneat">Kit Westneat</reporter>
                        <labels>
                    </labels>
                <created>Mon, 17 Aug 2015 19:21:44 +0000</created>
                <updated>Sat, 19 Sep 2015 05:32:29 +0000</updated>
                            <resolved>Sat, 19 Sep 2015 05:32:29 +0000</resolved>
                                                    <fixVersion>Lustre 2.8.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>8</watches>
                                                                            <comments>
                            <comment id="124454" author="jgmitter" created="Tue, 18 Aug 2015 17:18:47 +0000"  >&lt;p&gt;Hi Alex,&lt;br/&gt;
Can you investigate this issue?&lt;br/&gt;
Thanks.&lt;br/&gt;
Joe&lt;/p&gt;</comment>
                            <comment id="126148" author="gerrit" created="Thu, 3 Sep 2015 10:52:37 +0000"  >&lt;p&gt;Alex Zhuravlev (alexey.zhuravlev@intel.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/16213&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/16213&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-7014&quot; title=&quot;IAM index delete operation can require extra credits under certain situations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-7014&quot;&gt;&lt;del&gt;LU-7014&lt;/del&gt;&lt;/a&gt; osd: add additional credits for generic IAM delete&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: a2b19e4693aeee866cfbe0f66fd87eaef8d7c862&lt;/p&gt;</comment>
                            <comment id="127887" author="gerrit" created="Sat, 19 Sep 2015 03:34:46 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/16213/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/16213/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-7014&quot; title=&quot;IAM index delete operation can require extra credits under certain situations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-7014&quot;&gt;&lt;del&gt;LU-7014&lt;/del&gt;&lt;/a&gt; osd: add additional credits for generic IAM delete&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 5bfa3e3150a9de7c97aa6bcb5f9e2c00d1c0e030&lt;/p&gt;</comment>
                            <comment id="127897" author="pjones" created="Sat, 19 Sep 2015 05:32:29 +0000"  >&lt;p&gt;Landed for 2.8&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|hzxknb:</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>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>