<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:17:15 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-70832] Don&apos;t take DB lock in MODE_X when installing new sharding database metadata</title>
                <link>https://jira.mongodb.org/browse/SERVER-70832</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Database metadata refresh should not take the database lock in MODE_X. Instead, we should be able to do it under MODE_IX. This prevents database metadata refreshes from blocking behind ongoing transactions. This is similar to what &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40258&quot; title=&quot;Relax locking requirements for sharding metadata refresh on shards&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40258&quot;&gt;&lt;del&gt;SERVER-40258&lt;/del&gt;&lt;/a&gt; did for collection metadata refreshes.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2166323">SERVER-70832</key>
            <summary>Don&apos;t take DB lock in MODE_X when installing new sharding database metadata</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="antonio.fuschetto@mongodb.com">Antonio Fuschetto</assignee>
                                    <reporter username="jordi.serra-torrens@mongodb.com">Jordi Serra Torrens</reporter>
                        <labels>
                            <label>shardingemea-qw</label>
                    </labels>
                <created>Tue, 25 Oct 2022 13:38:33 +0000</created>
                <updated>Wed, 8 Nov 2023 11:16:44 +0000</updated>
                            <resolved>Mon, 30 Jan 2023 11:17:12 +0000</resolved>
                                    <version>6.1.1</version>
                    <version>6.2.0-rc6</version>
                                    <fixVersion>6.3.0-rc0</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>12</watches>
                                                                                                                <comments>
                            <comment id="5150669" author="xgen-internal-githook" created="Mon, 30 Jan 2023 11:11:13 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Antonio Fuschetto&apos;, &apos;email&apos;: &apos;antonio.fuschetto@mongodb.com&apos;, &apos;username&apos;: &apos;afuschetto&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-70832&quot; title=&quot;Don&amp;#39;t take DB lock in MODE_X when installing new sharding database metadata&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-70832&quot;&gt;&lt;del&gt;SERVER-70832&lt;/del&gt;&lt;/a&gt; Don&apos;t take DB lock in MODE_X when installing new sharding database metadata&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2772d1b849fc297e82aa166f45d03d93b77906ee&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2772d1b849fc297e82aa166f45d03d93b77906ee&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5025802" author="JIRAUSER1259062" created="Fri, 2 Dec 2022 17:12:57 +0000"  >&lt;p&gt;This change is not trivial as initially assumed and would cause at least one race condition. Relaxing the lock on database when the metadata is set from X mode to IX mode, the &lt;tt&gt;AutoGetDb&lt;/tt&gt; constructor is exposed to a race condition with the thread that refreshes the database metadata. The sequence of events triggering the problem are:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Thread A needs to access to a database, so the &lt;tt&gt;AutoGetDb&lt;/tt&gt; constructor is invoked (let say locking a database in IS mode).&lt;/li&gt;
	&lt;li&gt;The name is saved, the lock is acquired, but &lt;a href=&quot;https://github.com/10gen/mongo/blob/a879733c3c19b420ed86d20bfd60cb835ccb64d4/src/mongo/db/catalog_raii.cpp#L188-L189&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the database pointer is null&lt;/a&gt; because the &lt;tt&gt;DatabaseHolder&lt;/tt&gt; doesn&apos;t own any entry for the given name.&lt;/li&gt;
	&lt;li&gt;Now the thread B, that refreshes the database metadata, &lt;a href=&quot;https://github.com/10gen/mongo/blob/a879733c3c19b420ed86d20bfd60cb835ccb64d4/src/mongo/db/s/shard_filtering_metadata_refresh.cpp#L132-L134&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;retrieves the database metadata from the config server&lt;/a&gt; and &lt;a href=&quot;https://github.com/10gen/mongo/blob/a879733c3c19b420ed86d20bfd60cb835ccb64d4/src/mongo/db/s/shard_filtering_metadata_refresh.cpp#L154&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;acquires the database lock in IX mode (previously, in X mode, it would have waited)&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;The thread B &lt;a href=&quot;https://github.com/10gen/mongo/blob/a879733c3c19b420ed86d20bfd60cb835ccb64d4/src/mongo/db/s/shard_filtering_metadata_refresh.cpp#L160-L161&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;adds an entry in &lt;tt&gt;DatabaseHolder&lt;/tt&gt; and sets the database metadata&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;Now, on thread A, the &lt;tt&gt;AutoGetDb&lt;/tt&gt; constructor &lt;a href=&quot;https://github.com/10gen/mongo/blob/a879733c3c19b420ed86d20bfd60cb835ccb64d4/src/mongo/db/catalog_raii.cpp#L193&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;checks the database version&lt;/a&gt; and succeeds.&lt;/li&gt;
	&lt;li&gt;The thread A has an &lt;tt&gt;AutoGetDb&lt;/tt&gt; object that has been validated (version checked) but the internal pointer to the database is null.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Before &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-64209&quot; title=&quot;Push the DatabaseShardingState state to the Storage Catalog&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-64209&quot;&gt;&lt;del&gt;SERVER-64209&lt;/del&gt;&lt;/a&gt;, the database metadata was managed by the &lt;tt&gt;DatabaseShardingState&lt;/tt&gt; class. This machinery offers an additional locking resource to the hierarchy, that is DSS lock, which was use to synchronize the access to its information, such as the database metadata. It is presumable to assume that the DSS lock was created to have more fine-grained synchronization, in order to avoid locking the database resource directly.&lt;/p&gt;

&lt;p&gt;Now the database metadata is managed by the &lt;tt&gt;DatabaseHolder&lt;/tt&gt; class, since this is an information associated to the database directly (and this makes sense from the point of view that all collections are sharded). Although we have no fine grain mechanism mentioned above, unless to use the one currently exposed by the DSS or to implement something similar at the database level (to be used only for metadata access).&lt;/p&gt;

&lt;p&gt;We will discuss about this problem internally in order to find a solution fully compatibile with our future goals&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                                                <inwardlinks description="is caused by">
                                        <issuelink>
            <issuekey id="1994653">SERVER-64209</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2244369">SERVER-73345</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="720542">SERVER-40258</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.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_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23470"><![CDATA[v6.0]]></customfieldvalue>
    <customfieldvalue key="21777"><![CDATA[v5.0]]></customfieldvalue>
    <customfieldvalue key="18953"><![CDATA[v4.4]]></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_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5006R00001ob06QQAQ]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 27 Oct 2022 10:07:19 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 1 week, 2 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-2144</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>jordi.serra-torrens@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 1 week, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>antonio.fuschetto@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>jordi.serra-torrens@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i1fb1r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i19xs4:</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_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="6662">Sharding EMEA 2022-11-28</customfieldvalue>
    <customfieldvalue id="6663">Sharding EMEA 2022-12-12</customfieldvalue>
    <customfieldvalue id="6664">Sharding EMEA 2022-12-26</customfieldvalue>
    <customfieldvalue id="6810">Sharding EMEA 2023-01-09</customfieldvalue>
    <customfieldvalue id="6811">Sharding EMEA 2023-01-23</customfieldvalue>
    <customfieldvalue id="6812">Sharding EMEA 2023-02-06</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.33</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|i1ex73:</customfieldvalue>

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