<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:45:50 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-37384] Find by UUID must not return NamespaceNotFound without taking any database lock</title>
                <link>https://jira.mongodb.org/browse/SERVER-37384</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;A find by UUID &lt;a href=&quot;https://github.com/mongodb/mongo/blob/93fe6ccfb37d14f382abdf0e90abd013fbe8af7b/src/mongo/db/catalog_raii.cpp#L76&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;can return &lt;tt&gt;NamespaceNotFound&lt;/tt&gt; without taking any database lock&lt;/a&gt;. This allows a reader to see intermediate state from an operation that has the database locked in X mode and is performing catalog operations that may be rolled back. This is problematic for the rollbackViaRefetch algorithm, where a &lt;tt&gt;NamespaceNotFound&lt;/tt&gt; error is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/93fe6ccfb37d14f382abdf0e90abd013fbe8af7b/src/mongo/db/repl/rs_rollback.cpp#L1036&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;treated as a promise that the collection will be dropped in a future oplog entry&lt;/a&gt;. This can lead to inconsistent data between replica set members.&lt;/p&gt;</description>
                <environment></environment>
        <key id="611523">SERVER-37384</key>
            <summary>Find by UUID must not return NamespaceNotFound without taking any database lock</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="milkie@mongodb.com">Eric Milkie</assignee>
                                    <reporter username="tess.avitabile@mongodb.com">Tess Avitabile</reporter>
                        <labels>
                    </labels>
                <created>Fri, 28 Sep 2018 17:53:21 +0000</created>
                <updated>Sun, 29 Oct 2023 22:27:48 +0000</updated>
                            <resolved>Tue, 13 Nov 2018 20:05:52 +0000</resolved>
                                    <version>4.0.2</version>
                    <version>4.1.3</version>
                                    <fixVersion>4.1.6</fixVersion>
                                    <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="2060608" author="xgen-internal-githook" created="Tue, 13 Nov 2018 20:05:38 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Eric Milkie&apos;, &apos;email&apos;: &apos;milkie@10gen.com&apos;, &apos;username&apos;: &apos;milkie&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37384&quot; title=&quot;Find by UUID must not return NamespaceNotFound without taking any database lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37384&quot;&gt;&lt;del&gt;SERVER-37384&lt;/del&gt;&lt;/a&gt; lock db prior to examining UUID catalog, to avoid phantom NamespaceNotFound errors&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/f69f5a743962b6350d5830db0d03aaa4f815acf7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/f69f5a743962b6350d5830db0d03aaa4f815acf7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2050150" author="tess.avitabile" created="Fri, 2 Nov 2018 14:01:22 +0000"  >&lt;p&gt;Yes, I believe that would solve the problem in rollbackViaRefetch. We require that a &lt;tt&gt;find&lt;/tt&gt; not be able to see any uncommitted catalog changes, so you should only return &lt;tt&gt;NamespaceNotFound&lt;/tt&gt; if you have a database lock.&lt;/p&gt;</comment>
                            <comment id="2049946" author="kaloian.manassiev" created="Fri, 2 Nov 2018 09:33:39 +0000"  >&lt;p&gt;Actually at the time when &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-32367&quot; title=&quot;AutoGetCollectionOrView and its related classes perform shard version checking on a view&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-32367&quot;&gt;&lt;del&gt;SERVER-32367&lt;/del&gt;&lt;/a&gt; was implemented, the lockless resolution had to happen before the lock is acquired, because the semantics of collection UUIDs was that they are global and we wouldn&apos;t know exactly which database to lock.&lt;/p&gt;

&lt;p&gt;However I believe since then, we have gone back on the UUID semantics and now they need to be qualified with a database name, so we could lock the database first and then do the UUID -&amp;gt; NSS resolution in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/93fe6ccfb37d14f382abdf0e90abd013fbe8af7b/src/mongo/db/catalog_raii.cpp#L78&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;AutoGetCollection&lt;/a&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;?&lt;/p&gt;

&lt;p&gt;As far as auth is concerned, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/93fe6ccfb37d14f382abdf0e90abd013fbe8af7b/src/mongo/db/commands/count_cmd.cpp#L103&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;that we cannot fix&lt;/a&gt;, because like Eric says taking locks in the auth system opens up opportunities for DoS attack by unauthorized users.&lt;/p&gt;

&lt;p&gt;But in the case of rollbackViaRefetch, you should already be running at internal authorization and not go through the regular auth code, so that shouldn&apos;t matter. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt;, if we switched the order of locking/UUID resolution, would that solve the repl problem?&lt;/p&gt;</comment>
                            <comment id="2048513" author="milkie" created="Thu, 1 Nov 2018 01:57:06 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt; the link in the description you provided to the code that resolves UUIDs without locking can return NamespaceNotFound, but I believe prior to this point there is an auth check that does the same thing.  In Kal&apos;s code review here:  &lt;a href=&quot;https://mongodbcr.appspot.com/187170002&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mongodbcr.appspot.com/187170002&lt;/a&gt;  there was some discussion for why we want to avoid locking to do auth.&lt;br/&gt;
The first way I thought to fix this would be to lock the database and redo the UUID resolution, but that would mean that every find on a nonexistent collection would lock the database at auth time.  Based on the discussion in the code review, I&apos;m guessing this isn&apos;t something we&apos;re willing to pay.  I&apos;m open to other suggestions on how to fix this issue.  &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kaloian.manassiev&quot; class=&quot;user-hover&quot; rel=&quot;kaloian.manassiev&quot;&gt;kaloian.manassiev&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2018047" author="tess.avitabile" created="Fri, 28 Sep 2018 19:40:58 +0000"  >&lt;p&gt;That is a similar issue, but it did not fix the problem that you can see catalog changes that occur in a WUOW that can get rolled back.&lt;/p&gt;</comment>
                            <comment id="2017977" author="william.schultz" created="Fri, 28 Sep 2018 18:43:54 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt; Possibly related to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-34615&quot; title=&quot;find by UUID can return NamespaceNotFound for a collection that is concurrently renamed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-34615&quot;&gt;&lt;del&gt;SERVER-34615&lt;/del&gt;&lt;/a&gt;? &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="532591">SERVER-34615</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>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>Fri, 28 Sep 2018 18:43:54 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 13 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_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, 13 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>0.0</customfieldvalue>

                        </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>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>tess.avitabile@mongodb.com</customfieldvalue>
            <customfieldvalue>william.schultz@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu94tz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu16qn:</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="2595">Storage NYC 2018-11-05</customfieldvalue>
    <customfieldvalue id="2596">Storage NYC 2018-11-19</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|hu8r3b:</customfieldvalue>

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