<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:17:38 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-48618] Remove TODO&apos;s for SERVER-48618</title>
                <link>https://jira.mongodb.org/browse/SERVER-48618</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;b&gt;new description&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;We&apos;ve decided not to do what this ticket originally aimed to do. Remove TODO&apos;s for this ticket in the codebase.&lt;/p&gt;


&lt;p&gt;&lt;b&gt;old description&lt;/b&gt;&lt;br/&gt;
Passing an empty NamespaceString to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/bd74e903563e9c12bbaf3a027a8dc39ae6a1613d/src/mongo/db/s/operation_sharding_state.cpp#L80&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;OperationShardingState::initializeClientRoutingVersionsFromCommand() &lt;/a&gt;&#160;&#160;means the OperationShardingState cannot correctly store the shard/database version tied to the command.&lt;/p&gt;

&lt;p&gt;service_entry_point_common execCommandDatabase calls &lt;a href=&quot;https://github.com/mongodb/mongo/blob/bd74e903563e9c12bbaf3a027a8dc39ae6a1613d/src/mongo/db/service_entry_point_common.cpp#L1132&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;oss.initializeClientRoutingVersionsFromCommand(invocation-&amp;gt;ns(), request.body)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;However, not all commands that go through this path are derived from InvocationBase - thus invocation-&amp;gt;ns() yields an empty NamespaceString.&#160;&lt;/p&gt;

&lt;p&gt;List of commands we found that pass an empty NamespaceString to OperationShardingState::initializeClientRoutingVersionsFromCommand()&#160;that aren&apos;t derived from InvocationBase:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/bd74e903563e9c12bbaf3a027a8dc39ae6a1613d/src/mongo/db/s/config/configsvr_move_primary_command.cpp#L66&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ConfigSvrMovePrimaryCommand&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/config/configsvr_enable_sharding_command.cpp#L62&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ConfigSvrEnableShardingCommand&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Additionally, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/drop_connections_command.cpp#L73&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;DropConnectionsCmd&lt;/a&gt; derives from InvocationBase but passes an empty NamespaceString to OperationShardingState::initializeClientRoutingVersionsFromCommand().&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1373621">SERVER-48618</key>
            <summary>Remove TODO&apos;s for SERVER-48618</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="haley.connelly@mongodb.com">Haley Connelly</assignee>
                                    <reporter username="haley.connelly@mongodb.com">Haley Connelly</reporter>
                        <labels>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Fri, 5 Jun 2020 15:50:33 +0000</created>
                <updated>Sun, 29 Oct 2023 22:07:22 +0000</updated>
                            <resolved>Fri, 18 Sep 2020 18:36:36 +0000</resolved>
                                                    <fixVersion>4.8.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="3401316" author="xgen-internal-githook" created="Fri, 18 Sep 2020 17:38:55 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Haley Connelly&apos;, &apos;email&apos;: &apos;haley.connelly@mongodb.com&apos;, &apos;username&apos;: &apos;haleyConnelly&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48618&quot; title=&quot;Remove TODO&amp;#39;s for SERVER-48618&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48618&quot;&gt;&lt;del&gt;SERVER-48618&lt;/del&gt;&lt;/a&gt; Remove TODO&apos;s for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48618&quot; title=&quot;Remove TODO&amp;#39;s for SERVER-48618&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48618&quot;&gt;&lt;del&gt;SERVER-48618&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/0a6cb53bd220ceaae946ff5b1a4ddb51d0582348&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/0a6cb53bd220ceaae946ff5b1a4ddb51d0582348&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3399594" author="haley.connelly" created="Thu, 17 Sep 2020 17:46:21 +0000"  >&lt;p&gt;After some discussion, we&apos;ve decided not to move forward with the ticket, and are just going to remove TODO&apos;s for it instead.&lt;/p&gt;</comment>
                            <comment id="3380702" author="haley.connelly" created="Tue, 8 Sep 2020 19:39:27 +0000"  >&lt;p&gt;&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;, we discovered a scenario where the OSS tracks an incomplete/ inconsistent namespace, but don&apos;t have a good solution for its fix&#160;&lt;/p&gt;

&lt;p&gt; &lt;b&gt;Initializing OSS with incomplete namespace&lt;/b&gt; * mongos specifies the UUID rather&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/ac9aa69929bb2f1b9d5014aa3de5799abfded18c/src/mongo/db/pipeline/process_interface/mongos_process_interface.cpp#L157-L167&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;than the collection name&lt;/a&gt;, and explicitly specifies shard version UNSHARDED, to the find command when fetching the post image for unsharded collections (eg: in change streams).&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/ac9aa69929bb2f1b9d5014aa3de5799abfded18c/src/mongo/db/commands/find_cmd.cpp#L212-L215&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;FindCmd&lt;/a&gt;&#160;returns only the database for its ns().&lt;/li&gt;
	&lt;li&gt;The&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/cbd21efb0254b018e971113e2516ef307ee6fa38/src/mongo/db/service_entry_point_common.cpp#L1232&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;OperationShardingState::initializeClientRoutingVersionsFromCommand&lt;/a&gt;&#160;stores an entry in _shardVersions using only the database name rather than the full collection name&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Why the behavior isn&apos;t broken today despite OSS inconsistency&lt;/b&gt;&lt;br/&gt;
 (1) Issue FindCmd with UUID for dbName, explicitly send UNSHARDED with cmd.&lt;br/&gt;
 (2) OSS maps dbName to UNSHARDED&lt;br/&gt;
 (3) FindCmd constructs&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/ac9aa69929bb2f1b9d5014aa3de5799abfded18c/src/mongo/db/commands/find_cmd.cpp#L361&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;AutoGetCollectionForReadCommand&lt;/a&gt;&#160;with full namespace&lt;br/&gt;
 (4) AutoGetCollectionForReadCommand&apos;s constructor calls&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/69145064d3315c1f89bd7abfacde0087c5845501/src/mongo/db/db_raii.cpp#L257&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;css-&amp;gt;checkShardVersionOrThrow&lt;/a&gt;() and eventually leads to CollectionShardingRuntime::_getMetadataWithVersionCheckAt&lt;br/&gt;
 (5)&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/cbd21efb0254b018e971113e2516ef307ee6fa38/src/mongo/db/s/collection_sharding_runtime.cpp#L300&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;getOperationRecievedVersion&lt;/a&gt;, returns boost::none rather than UNSHARDED because it is called with the full nss (not just dbName and OSS doesn&apos;t have a matching entry in _shardVersions).&lt;br/&gt;
 (4) collection perceived as&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/cbd21efb0254b018e971113e2516ef307ee6fa38/src/mongo/db/s/collection_sharding_runtime.cpp#L302&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;UNSHARDED&lt;/a&gt;&#160;anyway&lt;/p&gt;</comment>
                            <comment id="3359392" author="haley.connelly" created="Tue, 25 Aug 2020 22:37:07 +0000"  >&lt;p&gt;Yes, it is possible that the user &lt;a href=&quot;https://github.com/mongodb/mongo/blob/48608c570f1357d640bc80d114b4d04cf6a55743/jstests/sharding/move_primary_basic.js#L35&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;can provide an empty namespace&lt;/a&gt; (it would fail eventually, but with the invariant in place, invariant first).&lt;/p&gt;

&lt;p&gt;Max brought up a good suggestion offline - if both conditions are true, throw (not invariant)&lt;br/&gt;
 (1) an invalid NamespaceString is provided AND&lt;br/&gt;
(2) a dbVersion or shardVersion is&lt;/p&gt;



&lt;p&gt;That way, commands that don&apos;t need to be versioned won&apos;t fail when they should pass. (See &#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/drop_connections_command.cpp#L73&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;DropConnectionsCmd&lt;/a&gt;&#160;for an example of a command that will always return an empty NamespaceString but shouldn&apos;t need to be versioned).&lt;/p&gt;</comment>
                            <comment id="3357720" author="kaloian.manassiev" created="Tue, 25 Aug 2020 14:03:44 +0000"  >&lt;p&gt;I don&apos;t quite understand the question. Are you saying that the namespace passed to the OSS is sometimes derived from how user formulated the command? Because if that is the case, yes we should uassert. If it however is derived from some internal code, then we have a bug and should fix it (therefore adding the invariant).&lt;/p&gt;</comment>
                            <comment id="3349873" author="haley.connelly" created="Thu, 20 Aug 2020 20:35:13 +0000"  >&lt;p&gt;Its not safe to invariant that the NSS is not empty inside the OperationShardingState.&lt;br/&gt;
Tests will hit that invariant when asserting commandFailed and fail later on.&lt;br/&gt;
eg) &lt;a href=&quot;https://github.com/mongodb/mongo/blob/48608c570f1357d640bc80d114b4d04cf6a55743/jstests/sharding/move_primary_basic.js#L35&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;move_primary_basic.js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Despite not inheriting from InvocationBase, the listed commands still succeed and provide a valid namespace to the OSS when they aren&apos;t specifically designed to fail.&lt;/p&gt;

&lt;p&gt;&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; We could uassert when the NamespaceString is empty rather than invariant. Or we could leave as is. Which do you prefer?&lt;/p&gt;</comment>
                            <comment id="3192712" author="haley.connelly" created="Fri, 5 Jun 2020 16:50:31 +0000"  >&lt;p&gt;Throughout OperationShardingState, we should probably enforce that the namespace passed in should not be empty (eg: for getShardVersion etc. as well).&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="458080">SERVER-31946</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1314209">SERVER-47532</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>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 25 Aug 2020 14:03:44 +0000</customfieldvalue>

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


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

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_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>
                            3 years, 20 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxdfd3:</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="4135">Sharding 2020-07-27</customfieldvalue>
    <customfieldvalue id="4136">Sharding 2020-08-10</customfieldvalue>
    <customfieldvalue id="4137">Sharding 2020-08-24</customfieldvalue>
    <customfieldvalue id="4252">Sharding 2020-09-21</customfieldvalue>
    <customfieldvalue id="4253">Sharding 2020-10-05</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|hxocof:</customfieldvalue>

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