<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:41:34 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-79661] Make &quot;internalRenameIfOptionsAndIndexesMatch&quot; command sharding-aware</title>
                <link>https://jira.mongodb.org/browse/SERVER-79661</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The &quot;internalRenameIfOptionsAndIndexesMatch&quot; is an internal command designed specifically to be used by $out. It renames a collection but fails if the indexes or options of the destination collection which is being overwritten by the rename do not match those of the source collection. $out works by writing the data to a temporary collection and then as a final step uses &quot;internalRenameIfOptionsAndIndexesMatch&quot; to replace the existing collection with the new data.&lt;/p&gt;

&lt;p&gt;For $out in sharded clusters, the node executing the $out always targets this command to the primary node of the db primary shard. My understanding is that this targeting behavior is acceptable because the db primary is supposed to coordinate DDL commands. However, the command is not sharding-aware in that it looks like it always performs the rename locally. If either the source or destination collections are unsplittable collections placed on a different shard, then the &quot;internalRenameIfOptionsAndIndexesMatch&quot; becomes a distributed operation. This situation will be possible once we allow unsharded collections to move rather than requiring them to reside on the primary shard.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2408041">SERVER-79661</key>
            <summary>Make &quot;internalRenameIfOptionsAndIndexesMatch&quot; command sharding-aware</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="jordi.serra-torrens@mongodb.com">Jordi Serra Torrens</assignee>
                                    <reporter username="david.storch@mongodb.com">David Storch</reporter>
                        <labels>
                            <label>pm3229-m1</label>
                    </labels>
                <created>Thu, 3 Aug 2023 14:41:01 +0000</created>
                <updated>Sun, 29 Oct 2023 21:18:02 +0000</updated>
                            <resolved>Mon, 9 Oct 2023 09:37:24 +0000</resolved>
                                                    <fixVersion>7.2.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="5762800" author="xgen-internal-githook" created="Mon, 9 Oct 2023 09:25:24 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Jordi Serra Torrens&apos;, &apos;email&apos;: &apos;jordi.serra-torrens@mongodb.com&apos;, &apos;username&apos;: &apos;jordist&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-79661&quot; title=&quot;Make &amp;quot;internalRenameIfOptionsAndIndexesMatch&amp;quot; command sharding-aware&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-79661&quot;&gt;&lt;del&gt;SERVER-79661&lt;/del&gt;&lt;/a&gt; Make the &apos;internalRenameIfOptionsAndIndexesMatch&apos; command sharding-aware&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/6176c2dbd68adc5094496db09aebd3abf7f960b6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/6176c2dbd68adc5094496db09aebd3abf7f960b6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5616668" author="JIRAUSER1257318" created="Mon, 7 Aug 2023 12:18:47 +0000"  >&lt;p&gt;Some ideas:&lt;br/&gt;
Since internalRenameIfOptionsAndIndexesMatch now needs to be sharding-aware and modify the sharding catalog, it should be implemented by using the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/rename_collection_coordinator.h&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;RenameCollectionCoordinator&lt;/a&gt;. We can either (a) make internalRenameIfOptionsAndIndexesMatch spin up a RenameCollectionCoordinator when in a sharded environment, or (b) make $out issue a _shardsvrRenameCollection command with some extra options about the &quot;options and indexes match&quot;. Both are to be executed by the dbPrimary shard.&lt;/p&gt;

&lt;p&gt;Either way, RenameCollectionCoordinator needs to be extended to support the &quot;option and indexes match&quot; functionality. Currently `internalRenameIfOptionsAndIndexesMatch` uses the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1aa6cc2c2ef07dfd1daefb0c4aea8be382291788/src/mongo/db/catalog/rename_collection.cpp#L808&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;database exclusive lock&lt;/a&gt; to ensure stability between checking the indexes/options and executing the (local) rename. On a sharded cluster, when the collection is not located on the primary shard, the DB lock does no longer provide the required guarantees. Instead, the DDL lock does (for the most part).&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;RenameCollectionCoordinator takes and holds DDL lock.&lt;/li&gt;
	&lt;li&gt;Changing collection options (collmod, create) serialize on the DDL lock.&lt;/li&gt;
	&lt;li&gt;Dropping indexes serialize on the DDL lock&lt;/li&gt;
	&lt;li&gt;&lt;font color=&quot;red&quot;&gt;Creating indexes does &lt;b&gt;not&lt;/b&gt; serialize on the DDL lock.&lt;/font&gt; (createIndexes is currently not a ShardingDDLCoordinator nor takes the DDL lock)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Unless createIndexes is changed to either take the DDL lock or become a ShardingDDLCoordinator, the &quot;index match&quot; check will be racy with concurrent index creation.&lt;/p&gt;</comment>
                            <comment id="5610396" author="david.storch" created="Thu, 3 Aug 2023 14:41:50 +0000"  >&lt;p&gt;CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jordi.serra-torrens%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;jordi.serra-torrens@mongodb.com&quot;&gt;jordi.serra-torrens@mongodb.com&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ivan.fefer%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;ivan.fefer@mongodb.com&quot;&gt;ivan.fefer@mongodb.com&lt;/a&gt;. Hopefully my description of this task is accurate &amp;#8211; let me know if there&apos;s anything you&apos;d like to add.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="2408214">SERVER-79670</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2451447">SERVER-81444</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2452278">SERVER-81484</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2408431">SERVER-79693</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2469430">SERVER-81975</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>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25125"><![CDATA[Query Execution]]></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>Mon, 7 Aug 2023 12:18:47 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        17 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-79670'>SERVER-79670</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-81444'>SERVER-81444</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-81484'>SERVER-81484</a></s>]]></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-3229</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>
                            17 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>135.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>david.storch@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|i2kowv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i22s9k:</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="7248">QE 2023-09-04</customfieldvalue>
    <customfieldvalue id="7719">Sharding EMEA 2023-10-02</customfieldvalue>
    <customfieldvalue id="7720">Sharding EMEA 2023-10-16</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|i2kb27:</customfieldvalue>

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