<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:49:30 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-60321] Lock-free reads can leave CollectionCatalog stashed</title>
                <link>https://jira.mongodb.org/browse/SERVER-60321</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If the root LFR operation is on a non-existing Collection it will not stash the &lt;tt&gt;CollectionCatalog&lt;/tt&gt; onto the &lt;tt&gt;OperationContext&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;If there is a nested LFR operation under a Lock-free read that did not stash the &lt;tt&gt;CollectionCatalog&lt;/tt&gt; the nested operation will instead do the stashing: &lt;a href=&quot;https://github.com/mongodb/mongo/blob/45bc7a2c06d788a2fddc8601450d4a1fb8dbf489/src/mongo/db/db_raii.cpp#L142&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/45bc7a2c06d788a2fddc8601450d4a1fb8dbf489/src/mongo/db/db_raii.cpp#L142&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the nested LFR lock helper is destroyed the &lt;tt&gt;CollectionCatalog&lt;/tt&gt; will not be unstashed because only the root LFR helper may unstash: &lt;a href=&quot;https://github.com/mongodb/mongo/blob/45bc7a2c06d788a2fddc8601450d4a1fb8dbf489/src/mongo/db/catalog/collection_catalog.cpp#L1163-L1167&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/45bc7a2c06d788a2fddc8601450d4a1fb8dbf489/src/mongo/db/catalog/collection_catalog.cpp#L1163-L1167&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But the root LFR lock helper will not unstash either because it never stashed anything: &lt;a href=&quot;https://github.com/mongodb/mongo/blob/45bc7a2c06d788a2fddc8601450d4a1fb8dbf489/src/mongo/db/catalog/collection_catalog.cpp#L1178&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/45bc7a2c06d788a2fddc8601450d4a1fb8dbf489/src/mongo/db/catalog/collection_catalog.cpp#L1178&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This can cause logic that runs after an operation, like the &lt;tt&gt;profile&lt;/tt&gt; operation, to use this stashed &lt;tt&gt;CollectionCatalog&lt;/tt&gt;. If the &lt;tt&gt;system.profile&lt;/tt&gt; collection is missing that would result in the &lt;tt&gt;profile&lt;/tt&gt; operation not being able to see the collection that was just created: &lt;a href=&quot;https://github.com/mongodb/mongo/blob/45bc7a2c06d788a2fddc8601450d4a1fb8dbf489/src/mongo/db/introspect.cpp#L142-L144&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/45bc7a2c06d788a2fddc8601450d4a1fb8dbf489/src/mongo/db/introspect.cpp#L142-L144&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This can happen on a secondary if the &lt;tt&gt;system.profile&lt;/tt&gt; collection is removed concurrently.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1886445">SERVER-60321</key>
            <summary>Lock-free reads can leave CollectionCatalog stashed</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="henrik.edin@mongodb.com">Henrik Edin</assignee>
                                    <reporter username="henrik.edin@mongodb.com">Henrik Edin</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Sep 2021 19:18:34 +0000</created>
                <updated>Sun, 29 Oct 2023 21:48:02 +0000</updated>
                            <resolved>Fri, 4 Mar 2022 15:52:30 +0000</resolved>
                                                    <fixVersion>6.0.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="4391488" author="xgen-internal-githook" created="Fri, 4 Mar 2022 14:41:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Henrik Edin&apos;, &apos;email&apos;: &apos;henrik.edin@mongodb.com&apos;, &apos;username&apos;: &apos;henrikedin&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60321&quot; title=&quot;Lock-free reads can leave CollectionCatalog stashed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60321&quot;&gt;&lt;del&gt;SERVER-60321&lt;/del&gt;&lt;/a&gt; Fix edge cases when setting up state for Lock-free reads&lt;/p&gt;

&lt;p&gt;When LFR is setup we should now always:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Open a storage snapshot&lt;/li&gt;
	&lt;li&gt;Stash the catalog&lt;/li&gt;
	&lt;li&gt;Mark the OperationContext that we are in LFR&lt;br/&gt;
None of the three is done if we are not LFR.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This fixes an edge case where the opCtx was marked as LFR when no&lt;br/&gt;
collection was found and no snapshot or catalog was stashed. A sub op&lt;br/&gt;
could then stash a catalog that wasn&apos;t cleaned up properly when tearing&lt;br/&gt;
down. Anything that happened afterwords, like the profile logic, now had&lt;br/&gt;
a stashed catalog when there should be none.&lt;/p&gt;

&lt;p&gt;Also fixed when we lock for reading on a view that we are not marking&lt;br/&gt;
the OperationContext to be LFR as we never opened a storage snapshot or&lt;br/&gt;
stashed the catalog.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3d6b70fbba9eaf468644d3a35429c71446f9c459&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3d6b70fbba9eaf468644d3a35429c71446f9c459&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.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>Thu, 17 Feb 2022 19:19:45 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 48 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_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, 48 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>15.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>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>henrik.edin@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i03omn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzzl1g:</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="5420">Execution Team 2021-11-01</customfieldvalue>
    <customfieldvalue id="5421">Execution Team 2021-11-15</customfieldvalue>
    <customfieldvalue id="5423">Execution Team 2021-12-13</customfieldvalue>
    <customfieldvalue id="5552">Execution Team 2022-02-07</customfieldvalue>
    <customfieldvalue id="5588">Execution Team 2022-02-21</customfieldvalue>
    <customfieldvalue id="5811">Execution Team 2022-03-07</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|i03arz:</customfieldvalue>

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