<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:39:12 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-10902] mdd_changelog_user_purge() must check current number of users safer and earlier to disable ChangeLogs recording if none</title>
                <link>https://jira.whamcloud.com/browse/LU-10902</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;During my analysis of a situation where a ChangeLogs user&apos;s purge was taking a very long time  (due to single user never being unregistered and idle since ages), I have found that the current code (still true in master) in mdd_changelog_user_purge() only disable ChangeLogs recording when the last user&apos;s purge has been synchronously done, meaning that more records will unnecessary continue to be recorded (and compete adding overhead) until the full purge completes :&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;int mdd_changelog_user_purge(const struct lu_env *env,
                             struct mdd_device *mdd, __u32 id)
{
        struct mdd_changelog_user_purge mcup = {
                .mcup_id = id,
                .mcup_found = false,
                .mcup_usercount = 0,
                .mcup_minrec = ULLONG_MAX,
        };
        struct llog_ctxt *ctxt;
        int rc;

        ENTRY;

        CDEBUG(D_IOCTL, &quot;%s: Purge request: id=%u\n&quot;,
               mdd2obd_dev(mdd)-&amp;gt;obd_name, id);

        ctxt = llog_get_context(mdd2obd_dev(mdd),
                                LLOG_CHANGELOG_USER_ORIG_CTXT);
        if (ctxt == NULL ||
            (ctxt-&amp;gt;loc_handle-&amp;gt;lgh_hdr-&amp;gt;llh_flags &amp;amp; LLOG_F_IS_CAT) == 0)
                GOTO(out, rc = -ENXIO);

        rc = llog_cat_process(env, ctxt-&amp;gt;loc_handle,
                              mdd_changelog_user_purge_cb, &amp;amp;mcup,
                              0, 0);

        if ((rc == 0) &amp;amp;&amp;amp; mcup.mcup_found) {
                CDEBUG(D_IOCTL, &quot;%s: Purging changelog entries for user %d &quot;
                       &quot;record=%llu\n&quot;,
                       mdd2obd_dev(mdd)-&amp;gt;obd_name, id, mcup.mcup_minrec);
                /* Cancelling record 0 destroys the entire changelog, make sure
                   we don&apos;t do that unless we mean it. */
                if (mcup.mcup_minrec != 0 || mcup.mcup_usercount == 0) {
                        rc = mdd_changelog_llog_cancel(env, mdd, &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; sync, and can take a long 
                                                       mcup.mcup_minrec); &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; time if huge backlog
                }
        } else {
                CWARN(&quot;%s: No changelog for user %u; rc=%d\n&quot;,
                      mdd2obd_dev(mdd)-&amp;gt;obd_name, id, rc);
                GOTO(out, rc = -ENOENT);
        }

        if ((rc == 0) &amp;amp;&amp;amp; (mcup.mcup_usercount == 0)) {
                /* No more users; turn changelogs off */
                CDEBUG(D_IOCTL, &quot;turning off changelogs\n&quot;);
                rc = mdd_changelog_off(env, mdd); &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; ChangeLog recording being stopped
        }

        EXIT;
out:
        if (ctxt != NULL)
                llog_ctxt_put(ctxt);

        return rc;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Also, ChangeLog recording is being stopped without any regard nor protection against the fact a new user may have registered in the interval, leading to a situation where a user can be registered but not ChangeLog recording will happen.&lt;/p&gt;

&lt;p&gt;Will push a patch soon to fix both problems.&lt;/p&gt;</description>
                <environment></environment>
        <key id="51772">LU-10902</key>
            <summary>mdd_changelog_user_purge() must check current number of users safer and earlier to disable ChangeLogs recording if none</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="bfaccini">Bruno Faccini</assignee>
                                    <reporter username="bfaccini">Bruno Faccini</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Apr 2018 13:39:11 +0000</created>
                <updated>Sun, 6 May 2018 04:29:01 +0000</updated>
                            <resolved>Sun, 6 May 2018 04:28:27 +0000</resolved>
                                                    <fixVersion>Lustre 2.12.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="226077" author="gerrit" created="Mon, 16 Apr 2018 13:43:47 +0000"  >&lt;p&gt;Faccini Bruno (bruno.faccini@intel.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/32007&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/32007&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10902&quot; title=&quot;mdd_changelog_user_purge() must check current number of users safer and earlier to disable ChangeLogs recording if none&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10902&quot;&gt;&lt;del&gt;LU-10902&lt;/del&gt;&lt;/a&gt; mdd: force disable changelogs early and safely&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 6ccf8c1cbafcfdc27ad1285b6f6f260bfc08b05e&lt;/p&gt;</comment>
                            <comment id="226439" author="bfaccini" created="Thu, 19 Apr 2018 23:44:06 +0000"  >&lt;p&gt;A use case leading to such scenario could occur if an old and unused changelog user is being unregistered and a new one is being registerd (like for a RobinHood operations restart from scratch including full-scan and start of Changelogs gather in parallel) but previous purge has still not completed due to some huge records back-log. &lt;/p&gt;</comment>
                            <comment id="227382" author="gerrit" created="Sun, 6 May 2018 03:42:27 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/32007/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/32007/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10902&quot; title=&quot;mdd_changelog_user_purge() must check current number of users safer and earlier to disable ChangeLogs recording if none&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10902&quot;&gt;&lt;del&gt;LU-10902&lt;/del&gt;&lt;/a&gt; mdd: force disable changelogs early and safely&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 99cc32b013d411335a694c5f94a83cef839c68c4&lt;/p&gt;</comment>
                            <comment id="227398" author="pjones" created="Sun, 6 May 2018 04:28:27 +0000"  >&lt;p&gt;Landed for 2.12&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </outwardlinks>
                                                        </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|hzzvn3:</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>