<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:26:52 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-74235] Create compound indexes before sharding collections in refine_collection_shard_key_crud_ops.js</title>
                <link>https://jira.mongodb.org/browse/SERVER-74235</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/a0ed1b8b5c5c0df47e36f1c1be6560cac924f2c1/jstests/concurrency/fsm_workloads/refine_collection_shard_key_crud_ops.js#L218&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Creating the compound index&lt;/a&gt; AFTER &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a0ed1b8b5c5c0df47e36f1c1be6560cac924f2c1/jstests/concurrency/fsm_workloads/refine_collection_shard_key_crud_ops.js#L216-L217&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;sharding the collection&lt;/a&gt; potentially allows the balancer to kick-in in the middle leading to a failure when &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a0ed1b8b5c5c0df47e36f1c1be6560cac924f2c1/jstests/concurrency/fsm_workloads/refine_collection_shard_key_crud_ops.js#L130-L131&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;trying to refine the shard key&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Lengthy explanation&lt;/b&gt;&lt;br/&gt;
During test setup the following actions are performed in a loop that goes from &lt;b&gt;fsmcoll0_25&lt;/b&gt; to &lt;b&gt;fsmcoll0_0&lt;/b&gt;:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/a0ed1b8b5c5c0df47e36f1c1be6560cac924f2c1/jstests/concurrency/fsm_workloads/refine_collection_shard_key_crud_ops.js#L216-L217&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Create the sharded collection&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/a0ed1b8b5c5c0df47e36f1c1be6560cac924f2c1/jstests/concurrency/fsm_workloads/refine_collection_shard_key_crud_ops.js#L216-L217&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Create the index to be used for refine&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Aftwerards, refine happens as part of the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a0ed1b8b5c5c0df47e36f1c1be6560cac924f2c1/jstests/concurrency/fsm_workloads/refine_collection_shard_key_crud_ops.js#L130-L131&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;refineCollectionShardKey state&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A test failure signaled that &lt;em&gt;shard0&lt;/em&gt; did not seem to have the index &lt;b&gt;{a:1, b:1}&lt;/b&gt; for &lt;b&gt;test15_fsmdb0.fsmcoll0_25&lt;/b&gt; when trying to refine the shard key from &lt;b&gt;{a:1}&lt;/b&gt; to &lt;b&gt;{a:1, b:1}&lt;/b&gt;. Question is: why was the index created during the setup not found when trying to refine the shard key?&lt;/p&gt;

&lt;p&gt;From the logs we can see that:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;The primary shard for &lt;b&gt;test15_fsmdb0&lt;/b&gt; is &lt;em&gt;shard1&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;The collection gets sharded&lt;/li&gt;
	&lt;li&gt;The balancer kicks in right when the doc is inserted in &lt;tt&gt;config.collections&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;A migration starts from &lt;em&gt;shard1&lt;/em&gt; to &lt;em&gt;shard0&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;The refined index is created&lt;/li&gt;
	&lt;li&gt;The migration succeeds&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The migration started on (4) resulted in the recipient &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a5100222e771814ced026b2040c1653cbf231f2c/src/mongo/db/s/migration_destination_manager.cpp#L814-L863&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;cloning the indexes&lt;/a&gt; before (5). Hence the index was never created on &lt;em&gt;shard0&lt;/em&gt; because &lt;tt&gt;createIndex&lt;/tt&gt; is not serialized with migrations and is only &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a5100222e771814ced026b2040c1653cbf231f2c/src/mongo/s/commands/cluster_create_indexes_cmd.cpp#L115-L125&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;sent with a scatter gather by routing table&lt;/a&gt; to the shards owning chunks (so - at time 4.5 - only to &lt;em&gt;shard1&lt;/em&gt;).&lt;/p&gt;</description>
                <environment></environment>
        <key id="2270996">SERVER-74235</key>
            <summary>Create compound indexes before sharding collections in refine_collection_shard_key_crud_ops.js</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="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</assignee>
                                    <reporter username="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Feb 2023 18:16:58 +0000</created>
                <updated>Sun, 29 Oct 2023 21:25:55 +0000</updated>
                            <resolved>Thu, 2 Mar 2023 22:29:24 +0000</resolved>
                                    <version>6.3.0-rc0</version>
                                    <fixVersion>7.0.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="5245076" author="xgen-internal-githook" created="Thu, 2 Mar 2023 21:07:15 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Pierlauro Sciarelli&apos;, &apos;email&apos;: &apos;pierlauro.sciarelli@mongodb.com&apos;, &apos;username&apos;: &apos;pierlauro&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-74235&quot; title=&quot;Create compound indexes before sharding collections in refine_collection_shard_key_crud_ops.js&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-74235&quot;&gt;&lt;del&gt;SERVER-74235&lt;/del&gt;&lt;/a&gt; Create compound indexes before sharding collections in refine_collection_shard_key_crud_ops.js&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1e62aa7aa34e190e844ee7728960b8ac78d9fe92&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1e62aa7aa34e190e844ee7728960b8ac78d9fe92&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                                                <inwardlinks description="is caused by">
                                        <issuelink>
            <issuekey id="913256">SERVER-43099</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>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25376"><![CDATA[v6.3]]></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, 21 Feb 2023 22:37:47 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        48 weeks, 6 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>
                            48 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1fjbk:</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="6814">Sharding EMEA 2023-03-06</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|i1wqa7:</customfieldvalue>

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