<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:34:04 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-33632] Make UUID catalog reload atomic</title>
                <link>https://jira.mongodb.org/browse/SERVER-33632</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The fuzzer uncovered an issue where the database was locked in global exclusive mode while the catalog was being modified. A concurrent thread performed UUID to namespace resolution, trying to query a collection, and got a NamespaceNotFound error because the UUID catalog was transiently empty.  This situation should not have been observable because of the global exclusive lock.&lt;/p&gt;</description>
                <environment></environment>
        <key id="504888">SERVER-33632</key>
            <summary>Make UUID catalog reload atomic</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="geert.bosch@mongodb.com">Geert Bosch</assignee>
                                    <reporter username="greg.mckeon@mongodb.com">Gregory McKeon</reporter>
                        <labels>
                    </labels>
                <created>Fri, 2 Mar 2018 19:33:38 +0000</created>
                <updated>Sun, 29 Oct 2023 22:34:12 +0000</updated>
                            <resolved>Tue, 17 Apr 2018 21:39:18 +0000</resolved>
                                                    <fixVersion>3.7.6</fixVersion>
                                    <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="1867017" author="xgen-internal-githook" created="Tue, 17 Apr 2018 21:37:36 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Geert Bosch&apos;, &apos;email&apos;: &apos;geert@mongodb.com&apos;, &apos;username&apos;: &apos;GeertBosch&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33632&quot; title=&quot;Make UUID catalog reload atomic&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33632&quot;&gt;&lt;del&gt;SERVER-33632&lt;/del&gt;&lt;/a&gt; UUIDCatalog queries fall back to pre-close state&lt;/p&gt;

&lt;p&gt;While the UUIDCatalog is closed for reloading during rollback and catalog reload,&lt;br/&gt;
queries by UUID may need to resolve the NSS for authorization purposes before taking&lt;br/&gt;
locks. Use a shadow catalog to allow such name resolution.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c45a62c24761110505161ce4ecc263f4bfce9c59&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c45a62c24761110505161ce4ecc263f4bfce9c59&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1824745" author="spencer" created="Tue, 6 Mar 2018 17:28:29 +0000"  >&lt;p&gt;Per offline discussion, UUID-&amp;gt;NS mapping resolution must be possible outside of DB locks for access control checks.&lt;/p&gt;

&lt;p&gt;Solution is to make all mutation to UUID catalog atomic by synchronizing within the UUIDCatalog object.&lt;/p&gt;</comment>
                            <comment id="1824251" author="kaloian.manassiev" created="Tue, 6 Mar 2018 13:08:13 +0000"  >&lt;p&gt;From the description of this ticket and from &lt;a href=&quot;https://jira.mongodb.org/browse/BF-8050?focusedCommentId=1814793&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1814793&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;this comment&lt;/a&gt; in BF-8050, I interpreted it as if the Global lock was not acquired by the applier thread during the &quot;Closing database catalog&quot;, but I see now that the times very close so this might be just a logging issue.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=louis.williams&quot; class=&quot;user-hover&quot; rel=&quot;louis.williams&quot;&gt;louis.williams&lt;/a&gt;, thanks for the explanation. I think I got a bit overzealous looking for a lock manager problem due to the above message, sorry about that.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=spencer&quot; class=&quot;user-hover&quot; rel=&quot;spencer&quot;&gt;spencer&lt;/a&gt;, the reason for doing the resolution outside of lock and then re-resolving was two-fold - one, because UUIDs can theoretically cross databases (if we start using them for cross-DB renames) and two, because the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e5e8dde676b585f5620608e95e93b9da295890c5/src/mongo/db/repl/sync_tail.cpp#L362&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;replication applier&lt;/a&gt; already takes advantage of this fact &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e5e8dde676b585f5620608e95e93b9da295890c5/src/mongo/db/repl/sync_tail.cpp#L285&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. In this case we don&apos;t have the owning database.&lt;/p&gt;

&lt;p&gt;Dave already started combining UUIDs together with the database name as part of &lt;a href=&quot;https://github.com/mongodb/mongo/commit/94db3aad060d11ddd799c9027f2bcbb342ddcccd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this&lt;/a&gt; commit. So if we require the catalog to be stable we could start locking the DB before performing checks, but that would require figuring out what DB to lock in initial sync.&lt;/p&gt;</comment>
                            <comment id="1823964" author="spencer" created="Tue, 6 Mar 2018 00:53:56 +0000"  >&lt;p&gt;Yes, we meant that the GlobalLock is held in mode X.&lt;/p&gt;

&lt;p&gt;I don&apos;t think the problem is around interruption, I think the problem is that AutoGetCollection resolves the UUID-&amp;gt;ns mapping before taking any locks.  According to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/catalog_raii.cpp#L70&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this comment&lt;/a&gt; this appears to be intentional, but I don&apos;t think it is safe/correct.&lt;/p&gt;

&lt;p&gt;I think we believed this was correct because we &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/catalog_raii.cpp#L81&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;re-resolve the ns-&amp;gt;UUID after taking the locks&lt;/a&gt;.  But if the UUID wasn&apos;t found in the cache at all, then &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/catalog_raii.cpp#L133&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;resolveNamespaceStringOrUUID throws NamespaceNotFound&lt;/a&gt; before we even get to do the double-check&lt;/p&gt;</comment>
                            <comment id="1823286" author="louis.williams" created="Mon, 5 Mar 2018 17:02:25 +0000"  >&lt;p&gt;I don&apos;t think this scenario is possible.&lt;br/&gt;
The GlobalLock constructor can only be interrupted in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/13b8e62cd9609f10688a1896cb80efa5d3c82859/src/mongo/db/concurrency/d_concurrency.cpp#L174&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;lockGlobalComplete&lt;/a&gt;, so if GlobalLock::waitForLockUntil() does not throw, a lock has to have either been acquired or timed out.&lt;br/&gt;
If the lock acquisition is interrupted during lockComplete, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/13b8e62cd9609f10688a1896cb80efa5d3c82859/src/mongo/db/concurrency/lock_state.cpp#L783&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;it will remove the LockRequest&lt;/a&gt;, which means that isLocked() cannot be true.&lt;br/&gt;
Because lockBegin() is not interruptible (yet), when &lt;a href=&quot;https://github.com/mongodb/mongo/blob/13b8e62cd9609f10688a1896cb80efa5d3c82859/src/mongo/db/concurrency/d_concurrency.cpp#L169&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_result == LOCK_OK, when set by lockBegin&lt;/a&gt;, there are no more points where the constructor could be interrupted again.&lt;/p&gt;
</comment>
                            <comment id="1822219" author="kaloian.manassiev" created="Sat, 3 Mar 2018 14:39:13 +0000"  >&lt;p&gt;The description of the ticket says &quot;database is locked in Global exclusive mode&quot; - did you mean to say the database was locked in X mode or that the Global X lock was being held? From reading BF-8050 it sounds like the latter, but wanted to confirm.&lt;/p&gt;

&lt;p&gt;Regardless, the Global X lock should conflict with whatever DB mode lock is being held.&lt;/p&gt;

&lt;p&gt;I looked at the DBLock code and I see that if the global lock acquisition is interrupted for some reason, the GlobalLock object will get wrongly constructed in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/13b8e62cd9609f10688a1896cb80efa5d3c82859/src/mongo/db/concurrency/d_concurrency.cpp#L141&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;isLocked() == true&lt;/a&gt; state, because &lt;a href=&quot;https://github.com/mongodb/mongo/blob/13b8e62cd9609f10688a1896cb80efa5d3c82859/src/mongo/db/concurrency/d_concurrency.cpp#L172&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;waitForLockUntil&lt;/a&gt; does not throw, but we already &lt;a href=&quot;https://github.com/mongodb/mongo/blob/13b8e62cd9609f10688a1896cb80efa5d3c82859/src/mongo/db/concurrency/d_concurrency.cpp#L169&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;set GlobalLock::_result&lt;/a&gt; to LOCK_OK. Later on, the DBLock will just &lt;a href=&quot;https://github.com/mongodb/mongo/blob/13b8e62cd9609f10688a1896cb80efa5d3c82859/src/mongo/db/concurrency/d_concurrency.cpp#L199&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;proceed&lt;/a&gt; with acquiring the DB lock, but in reality would not have acquired the Global part of the hierarchy.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=geert.bosch&quot; class=&quot;user-hover&quot; rel=&quot;geert.bosch&quot;&gt;geert.bosch&lt;/a&gt;, am I understanding this correctly? There didn&apos;t use to be a way for the GlobalLock object to be constructed unlocked until we introduced interruptability, but now it can happen.&lt;/p&gt;</comment>
                            <comment id="1821697" author="judah.schvimer" created="Fri, 2 Mar 2018 19:54:09 +0000"  >&lt;p&gt;After this is fixed, we should un-blacklist &quot;restartCatalog&quot; from the fuzzer to see what other bugs it will catch. See &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33474&quot; title=&quot;Blacklist restart_catalog.js from suites involving initial sync&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33474&quot;&gt;&lt;del&gt;SERVER-33474&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="1821663" author="spencer" created="Fri, 2 Mar 2018 19:34:20 +0000"  >&lt;p&gt;We believe the problem is that all UUID-&amp;gt;Namespace resolution needs to happen under a global lock of some form.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="473017">SERVER-32367</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2128056">SERVER-69389</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="397687">SERVER-29839</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="532591">SERVER-34615</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="501826">SERVER-33474</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.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>Fri, 2 Mar 2018 19:34:20 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 43 weeks, 1 day 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-842</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>
                            5 years, 43 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>63.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>geert.bosch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>greg.mckeon@mongodb.com</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
            <customfieldvalue>spencer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htrkgv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htikhr:</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_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="2199">Storage NYC 2018-03-26</customfieldvalue>
    <customfieldvalue id="2200">Storage NYC 2018-04-09</customfieldvalue>
    <customfieldvalue id="2251">Storage NYC 2018-04-23</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|htr6nb:</customfieldvalue>

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