<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:04:07 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-65969] Migration completion must not be signaled before releasing the ActiveMigrationRegistry</title>
                <link>https://jira.mongodb.org/browse/SERVER-65969</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;This may be a very rare race condition, but it&apos;s worth mentioning it since it has required a lot of investigation on a failing test in a patch. It can happen if the CSRS steps down during any tests issuing 2 subsequent &lt;em&gt;&lt;tt&gt;moveChunk&lt;/tt&gt;&lt;/em&gt; commands on different ranges (e.g. &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1aa6b2bba7b60fd4ffbcaf1c7c9c5a23a09718a0/jstests/sharding/txn_two_phase_commit_failure.js#L61-L64&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;When a &lt;em&gt;&lt;tt&gt;_shardsvrMoveRange&lt;/tt&gt;&lt;/em&gt; command (&lt;em&gt;&lt;tt&gt;moveChunk&lt;/tt&gt;&lt;/em&gt; in previous versions) is joining an ongoing migration, it &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1aa6b2bba7b60fd4ffbcaf1c7c9c5a23a09718a0/src/mongo/db/s/shardsvr_move_range_command.cpp#L155&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;waits for the completion&lt;/a&gt; of the original migration that &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1aa6b2bba7b60fd4ffbcaf1c7c9c5a23a09718a0/src/mongo/db/s/shardsvr_move_range_command.cpp#L150&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;is signaled&lt;/a&gt; before &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1aa6b2bba7b60fd4ffbcaf1c7c9c5a23a09718a0/src/mongo/db/s/active_migrations_registry.cpp#L277&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;releasing the ActiveMigrationRegistry&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As a result, the following flow could be reproduced:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Router sends &lt;em&gt;&lt;tt&gt;moveChunk&lt;/tt&gt;&lt;/em&gt; to CSRS node A&lt;/li&gt;
	&lt;li&gt;CSRS node A sends &lt;em&gt;&lt;tt&gt;_shardsvrMoveRange&lt;/tt&gt;&lt;/em&gt; to shard&lt;/li&gt;
	&lt;li&gt;CSRS node A steps-down and CSRS node B steps up&lt;/li&gt;
	&lt;li&gt;Router receives an error from CSRS node A, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1aa6b2bba7b60fd4ffbcaf1c7c9c5a23a09718a0/src/mongo/s/commands/cluster_move_chunk_cmd.cpp#L202&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;retries the moveChunk&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;CSRS node B sends &lt;em&gt;&lt;tt&gt;_shardsvrMoveRange&lt;/tt&gt;&lt;/em&gt; to shard, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1aa6b2bba7b60fd4ffbcaf1c7c9c5a23a09718a0/src/mongo/db/s/shardsvr_move_range_command.cpp#L155&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;joining ongoing migration&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;The ongoing migration succeeds, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1aa6b2bba7b60fd4ffbcaf1c7c9c5a23a09718a0/src/mongo/db/s/shardsvr_move_range_command.cpp#L150&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;signals completion&lt;/a&gt; before releasing the &lt;em&gt;ActiveMigrationRegistry&lt;/em&gt;&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;very fast&amp;#93;&lt;/span&gt; Router receives success from CSRS node B, sends a new &lt;em&gt;&lt;tt&gt;moveChunk&lt;/tt&gt;&lt;/em&gt; for a different range&lt;/li&gt;
	&lt;li&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;very fast&amp;#93;&lt;/span&gt; CSRS B forwards the new operation to the shard&lt;/li&gt;
	&lt;li&gt;Shard replies with error because the &lt;em&gt;ActiveMigrationRegistry&lt;/em&gt; has not been released yet (so the test fails)&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment></environment>
        <key id="2033381">SERVER-65969</key>
            <summary>Migration completion must not be signaled before releasing the ActiveMigrationRegistry</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="paolo.polato@mongodb.com">Paolo Polato</assignee>
                                    <reporter username="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Apr 2022 15:55:32 +0000</created>
                <updated>Sun, 29 Oct 2023 21:39:00 +0000</updated>
                            <resolved>Tue, 17 May 2022 10:59:28 +0000</resolved>
                                                    <fixVersion>6.0.0-rc8</fixVersion>
                    <fixVersion>6.1.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="4580278" author="xgen-internal-githook" created="Sun, 29 May 2022 20:43:32 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Paolo Polato&apos;, &apos;email&apos;: &apos;paolo.polato@mongodb.com&apos;, &apos;username&apos;: &apos;ppolato&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-65969&quot; title=&quot;Migration completion must not be signaled before releasing the ActiveMigrationRegistry&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-65969&quot;&gt;&lt;del&gt;SERVER-65969&lt;/del&gt;&lt;/a&gt; Fix data race in ScopedDonateChunk&lt;/p&gt;

&lt;p&gt;(cherry picked from commit bfee7c7eaef29fef0a1ec443d0527e335c18d756)&lt;br/&gt;
(cherry picked from commit cb69b7f2bcfe4d7eb50da54d6e308b61ff29e6f6)&lt;br/&gt;
Branch: v6.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/491f15aaca5d9c4f8a808f6a0a449ad6499467e3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/491f15aaca5d9c4f8a808f6a0a449ad6499467e3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4552381" author="xgen-internal-githook" created="Tue, 17 May 2022 10:55:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Paolo Polato&apos;, &apos;email&apos;: &apos;paolo.polato@mongodb.com&apos;, &apos;username&apos;: &apos;ppolato&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-65969&quot; title=&quot;Migration completion must not be signaled before releasing the ActiveMigrationRegistry&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-65969&quot;&gt;&lt;del&gt;SERVER-65969&lt;/del&gt;&lt;/a&gt; Fix data race in ScopedDonateChunk&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/bfee7c7eaef29fef0a1ec443d0527e335c18d756&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/bfee7c7eaef29fef0a1ec443d0527e335c18d756&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23470"><![CDATA[v6.0]]></customfieldvalue>
    
                        </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, 16 May 2022 14:08:49 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 36 weeks, 3 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>
                            1 year, 36 weeks, 3 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>paolo.polato@mongodb.com</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|i0slt3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0bjuw:</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="6074">Sharding EMEA 2022-05-16</customfieldvalue>
    <customfieldvalue id="6075">Sharding EMEA 2022-05-30</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|i0s7yf:</customfieldvalue>

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