<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:08:00 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>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-67383] Layering violation in the lock manager</title>
                <link>https://jira.mongodb.org/browse/SERVER-67383</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The RAII classes in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b06eb97f6f440a52010eef40f1da7af5fa3a2a0f/src/mongo/db/concurrency/d_concurrency.h#L43&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;d_concurrency.h/.cpp&lt;/tt&gt;&lt;/a&gt; are strictly part of the lock manager. As such, they should be completely decoupled from the database/collection catalog and should not know about UUIDs or anything else that is strictly catalog.&lt;/p&gt;

&lt;p&gt;This is not the case currently since the &lt;tt&gt;CollectionLock&lt;/tt&gt; object at the very least &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b06eb97f6f440a52010eef40f1da7af5fa3a2a0f/src/mongo/db/concurrency/d_concurrency.cpp#L285&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;is aware of the collection catalog&lt;/a&gt; which is a layering violation that can lead to bugs such as &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-67382&quot; title=&quot;Race condition in the UUID &amp;lt;-&amp;gt; NSS resolution in the multi-collection locking path&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-67382&quot;&gt;&lt;del&gt;SERVER-67382&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;UPDATE:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Proposed solution is to add a lightweight RAII type on top of the CollectionLock use. The selection to use the CollectionLock in the first place, over AutoGetCollection*, may imply that sharding/view/storage checks are not desired for the use cases. So we&apos;d have to investigate what works.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2072493">SERVER-67383</key>
            <summary>Layering violation in the lock manager</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="gregory.noma@mongodb.com">Gregory Noma</assignee>
                                    <reporter username="kaloian.manassiev@mongodb.com">Kaloian Manassiev</reporter>
                        <labels>
                            <label>catalog</label>
                            <label>techdebt</label>
                    </labels>
                <created>Mon, 20 Jun 2022 11:33:22 +0000</created>
                <updated>Sun, 29 Oct 2023 21:36:41 +0000</updated>
                            <resolved>Fri, 16 Sep 2022 20:30:39 +0000</resolved>
                                                    <fixVersion>6.2.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="4835001" author="xgen-internal-githook" created="Fri, 16 Sep 2022 20:30:23 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Gregory Noma&apos;, &apos;email&apos;: &apos;gregory.noma@gmail.com&apos;, &apos;username&apos;: &apos;gregorynoma&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-67383&quot; title=&quot;Layering violation in the lock manager&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-67383&quot;&gt;&lt;del&gt;SERVER-67383&lt;/del&gt;&lt;/a&gt; Track resource names using `ResourceCatalog`&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/bfd35c950c9863ef08b8f7adbdf760820ef4da96&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/bfd35c950c9863ef08b8f7adbdf760820ef4da96&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4835000" author="xgen-internal-githook" created="Fri, 16 Sep 2022 20:30:21 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Gregory Noma&apos;, &apos;email&apos;: &apos;gregory.noma@gmail.com&apos;, &apos;username&apos;: &apos;gregorynoma&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-67383&quot; title=&quot;Layering violation in the lock manager&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-67383&quot;&gt;&lt;del&gt;SERVER-67383&lt;/del&gt;&lt;/a&gt; Use `CollectionNamespaceOrUUIDLock` to lock collections via UUID&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ec54f761d043e56cf484de864a89c3645223f878&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ec54f761d043e56cf484de864a89c3645223f878&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4720926" author="dianna.hohensee" created="Tue, 2 Aug 2022 13:28:36 +0000"  >&lt;p&gt;Spoke with Kal, and updated the ticket description with the proposed solution.&lt;/p&gt;</comment>
                            <comment id="4710842" author="kaloian.manassiev" created="Thu, 28 Jul 2022 06:53:35 +0000"  >&lt;p&gt;d_concurrency is a library strictly about locking RAII and the lock manager locks by namespaces, not by UUID. The UUID to namespace conversion is something that happens in the layer above the lock manager.&lt;/p&gt;

&lt;p&gt;All that I am asking is that d_concurrency is left to not rely on the CollectionCatalog. If there is any site that needs to lock by UUID, it should either be using AutoGetCollection, which already does that conversion or there should be something between AutoGetCollection and d_concurrency which does it and is not linked in d_concurrency.&lt;/p&gt;</comment>
                            <comment id="4709627" author="dianna.hohensee" created="Wed, 27 Jul 2022 18:24:00 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kaloian.manassiev%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;kaloian.manassiev@mongodb.com&quot;&gt;kaloian.manassiev@mongodb.com&lt;/a&gt;&#160;let me know if there are any dependencies of which I&apos;m unaware on this work. I think we would need to see some significant gains to motivate decoupling this, to counter the loss of ease of use.&lt;/p&gt;</comment>
                            <comment id="4709610" author="dianna.hohensee" created="Wed, 27 Jul 2022 18:20:49 +0000"  >&lt;p&gt;Conceptually, the &lt;tt&gt;LockManager&lt;/tt&gt;&#160;treats namespaces as unique identifiers. Since commands are run targeting specific UUIDs, there must be a way to ascertain that the namespace still matches the UUID requested to be locked. &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b06eb97f6f440a52010eef40f1da7af5fa3a2a0f/src/mongo/db/concurrency/d_concurrency.cpp#L285-L308&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;The &lt;tt&gt;CollectionLock&lt;/tt&gt; constructor takes &lt;tt&gt;nssOrUUID&lt;/tt&gt; as input and handles the UUID/namespace resolution internally without the caller needing to be aware&lt;/a&gt;. &lt;b&gt;There is a pile of CollectionLock call sites all throughout the codebase, most of which take namespace, but maybe a dozen of which take UUID.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;I don&apos;t see any improvement in simply adding a layer between &lt;tt&gt;CollectionLock&lt;/tt&gt;&#160;and all the existing call sites that currently create &lt;tt&gt;CollectionLock&lt;/tt&gt;s. &lt;tt&gt;CollectionLock&lt;/tt&gt; would be unusable without the wrapper using the &lt;tt&gt;CollectionCatalog&lt;/tt&gt;. However, we could selectively specially wrap the UUID callers only. This would effectively undo the code cleanup of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42527&quot; title=&quot;Create CollectionLock constructor that uses UUID&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42527&quot;&gt;&lt;del&gt;SERVER-42527&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I don&apos;t see any pressing reasons to separate out the &lt;tt&gt;CollectionCatalog&lt;/tt&gt; from the &lt;tt&gt;d_concurrency&lt;/tt&gt; files. The code appears cleaner and easier to understand and use combined. And facilitates future changes towards more UUID usage. I&apos;m inclined to leave the code as is, unless there&apos;s good reason to change it. All callers taking collection level locks directly undoubtedly proceed to access the collection through the CollectionCatalog, so the linking will occur regardless.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2072491">SERVER-67382</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 21 Jun 2022 16:56:44 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 20 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10553" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Flagged</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10442"><![CDATA[Impediment]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 20 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>dianna.hohensee@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>gregory.noma@mongodb.com</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0z9jb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0jqhb:z3</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="6330">Execution Team 2022-09-19</customfieldvalue>
    <customfieldvalue id="6331">Execution Team 2022-10-03</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0yvon:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>