<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:32:20 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-53973] Migration manager recovery should handle failed findIntersectingChunk during refineShardKey</title>
                <link>https://jira.mongodb.org/browse/SERVER-53973</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The call to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ee1e7ff4575e1b5b7d5957feef60206f80dc22cc/src/mongo/db/s/balancer/migration_manager.cpp#L351&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;findIntersectingChunkWithSimpleCollation&lt;/a&gt; is being called with the original shard key after a refineShardKey operation. This results in a ShardKeyNotFound exception being thrown which goes unhandled.&lt;/p&gt;

&lt;p&gt;This should have been addressed by the changes in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48365&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-48365&lt;/a&gt; by making sure that the migration recovery entries are written while holding the dist lock. However, there is an interleaving where this is not the case.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1597708">SERVER-53973</key>
            <summary>Migration manager recovery should handle failed findIntersectingChunk during refineShardKey</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="tommaso.tocci@mongodb.com">Tommaso Tocci</assignee>
                                    <reporter username="alex.taskov@mongodb.com">Alexander Taskov</reporter>
                        <labels>
                            <label>Sharding-EMEA</label>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Fri, 22 Jan 2021 15:38:25 +0000</created>
                <updated>Sun, 29 Oct 2023 21:58:33 +0000</updated>
                            <resolved>Tue, 30 Mar 2021 09:56:13 +0000</resolved>
                                    <version>4.4.4</version>
                                    <fixVersion>4.4.6</fixVersion>
                    <fixVersion>5.0.0-rc0</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="3706643" author="xgen-internal-githook" created="Wed, 7 Apr 2021 21:36:59 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Tommaso Tocci&apos;, &apos;email&apos;: &apos;tommaso.tocci@mongodb.com&apos;, &apos;username&apos;: &apos;toto-dev&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53973&quot; title=&quot;Migration manager recovery should handle failed findIntersectingChunk during refineShardKey&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53973&quot;&gt;&lt;del&gt;SERVER-53973&lt;/del&gt;&lt;/a&gt; Migration manager recovery should handle failed findIntersectingChunk during refineShardKey&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/469b1101cea8cf0c5b34437cdeb391b7002f7d19&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/469b1101cea8cf0c5b34437cdeb391b7002f7d19&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3690717" author="xgen-internal-githook" created="Tue, 30 Mar 2021 09:50:57 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Tommaso Tocci&apos;, &apos;email&apos;: &apos;tommaso.tocci@mongodb.com&apos;, &apos;username&apos;: &apos;toto-dev&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53973&quot; title=&quot;Migration manager recovery should handle failed findIntersectingChunk during refineShardKey&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53973&quot;&gt;&lt;del&gt;SERVER-53973&lt;/del&gt;&lt;/a&gt; Migration manager recovery should handle failed findIntersectingChunk during refineShardKey&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1256d8e67a6b4bb88875cbc112987bbc8fffe76b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1256d8e67a6b4bb88875cbc112987bbc8fffe76b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3687614" author="tommaso.tocci" created="Sat, 27 Mar 2021 12:41:58 +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; was right about the racing scenario, I&apos;ve been able to reproduce it by adding a couple of sleeps. &lt;a href=&quot;https://github.com/toto-dev/mongo/commit/0a000591ab8cb883331efcb975fd19cf1a71ab41&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;This is patch to reproduce the error&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3653818" author="kaloian.manassiev" created="Tue, 9 Mar 2021 07:33:07 +0000"  >&lt;p&gt;I think the problem is just that the following race condition can happen:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;A migration starts, which &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d0004a3e0239570a2602af35f14a84a47fb290b1/src/mongo/db/s/balancer/migration_manager.cpp#L523&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;takes the dist lock&lt;/a&gt;, then &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d0004a3e0239570a2602af35f14a84a47fb290b1/src/mongo/db/s/balancer/migration_manager.cpp#L547&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;writes&lt;/a&gt; document with shardKey {a: 1}, which majority commits (so there is actually no order issue)&lt;/li&gt;
	&lt;li&gt;Step-down happens of that same node, followed by step-up, but on the config server we &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8f5b19480757929c98a5d7675c4c1762b32b09e9/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp#L864&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;throw-out the dist locks&lt;/a&gt; unconditionally&lt;/li&gt;
	&lt;li&gt;Before the Balancer recovery has managed to run and re-acquire the dist locks, a refine shard key sneaks-in&lt;/li&gt;
	&lt;li&gt;Now the Balancer recovery has a wrong shard key&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I think it will be extremely difficult to fix the distributed lock unlocking issue, so instead we should just address the crash by try/catching the lookup of the chunk in the ChunkManager and abandoning that migration recovery in that case.&lt;/p&gt;</comment>
                            <comment id="3646441" author="tommaso.tocci" created="Thu, 4 Mar 2021 12:27:42 +0000"  >&lt;p&gt;I&apos;ll bounce back this to &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alex.taskov&quot; class=&quot;user-hover&quot; rel=&quot;alex.taskov&quot;&gt;alex.taskov&lt;/a&gt; to add more context.&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="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1934459">SERVER-61755</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 29 Jan 2021 16:13:12 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 44 weeks 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>
                            2 years, 44 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>26.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>alex.taskov@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>tommaso.tocci@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyqtgf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyctjz:</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="4485">Sharding 2021-02-22</customfieldvalue>
    <customfieldvalue id="4486">Sharding 2021-03-08</customfieldvalue>
    <customfieldvalue id="4487">Sharding 2021-03-22</customfieldvalue>
    <customfieldvalue id="4497">Sharding 2021-04-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|hyqfpj:</customfieldvalue>

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