<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:35:41 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-77479] Sharded rename participants may incorrectly snapshot/restore pending range deletion documents</title>
                <link>https://jira.mongodb.org/browse/SERVER-77479</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/348fa10364894cbd598ea58112a43b4d7cecf215/src/mongo/db/s/rename_collection_coordinator.cpp#L657-L660&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;When stopping migrations&lt;/a&gt; on a sharded collection being renamed, the flow leads to a refresh on every shard in order for them to discover the &lt;tt&gt;stopMigrations&lt;/tt&gt; flag and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/348fa10364894cbd598ea58112a43b4d7cecf215/src/mongo/db/s/shard_filtering_metadata_refresh.cpp#L409-L411&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;abort ongoing migrations&lt;/a&gt; before returning.&lt;/p&gt;

&lt;p&gt;However, in case of donor step-down right at the end of a refresh, it may happen that the refresh succeeds even though the abortion has failed: &lt;a href=&quot;https://github.com/mongodb/mongo/blob/bbdc1347cdf2533f81b6fd05715c4ef1a092f5a6/src/mongo/db/s/shard_filtering_metadata_refresh.cpp#L501&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this wait for abortion&lt;/a&gt; never throws because the migration source manager &lt;a href=&quot;https://github.com/mongodb/mongo/blob/bbdc1347cdf2533f81b6fd05715c4ef1a092f5a6/src/mongo/db/s/migration_source_manager.cpp#L330&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;doesn&apos;t invalidate the future in case of error&lt;/a&gt;. This means that the refresh spawned by &lt;tt&gt;stopMigration&lt;/tt&gt; succeeds and the coordinator can proceed with &lt;a href=&quot;https://github.com/mongodb/mongo/blob/348fa10364894cbd598ea58112a43b4d7cecf215/src/mongo/db/s/rename_collection_coordinator.cpp#L668&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the next phase&lt;/a&gt; before the abortion completes by &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d8beee9e1507f68a1a231ef73f24c21cfd44bffd/src/mongo/db/s/migration_coordinator.cpp#L311-L312&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;locally deleting the range deletion document&lt;/a&gt; and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d8beee9e1507f68a1a231ef73f24c21cfd44bffd/src/mongo/db/s/migration_coordinator.cpp#L346-L351&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;flagging the range deletion task as ready&lt;/a&gt; on the recipient side.&lt;/p&gt;

&lt;p&gt;This is problematic because:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/348fa10364894cbd598ea58112a43b4d7cecf215/src/mongo/db/s/rename_collection_participant_service.cpp#L327&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;When snapshotting range deletions&lt;/a&gt; a rename participant may end up copying a document flagged as &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d8beee9e1507f68a1a231ef73f24c21cfd44bffd/src/mongo/db/s/range_deletion_task.idl#L71-L74&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;pending&lt;/a&gt; right before the migration  deletes it (in case of donor) or unflags it (in case of recipient)&lt;/li&gt;
	&lt;li&gt;The pending task would then &lt;a href=&quot;https://github.com/mongodb/mongo/blob/348fa10364894cbd598ea58112a43b4d7cecf215/src/mongo/db/s/rename_collection_participant_service.cpp#L356&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;be restored in the next phase&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The result is that:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;On the donor side: if the range deletion document gets deleted right between step 1 and 2, the document restored at 2 would forever be marked as &quot;pending&quot;.&lt;/li&gt;
	&lt;li&gt;On the recipient side: if the range deletion happens to be executed right between step 1 and 2, the document restored at 2 would forever be marked as &quot;pending&quot;.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;font color=&quot;red&quot;&gt;At the time of writing, this ticket affects all versions supporting sharded rename, hence all versions &amp;gt;= v5.0.0&lt;/font&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2350546">SERVER-77479</key>
            <summary>Sharded rename participants may incorrectly snapshot/restore pending range deletion documents</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>
                            <label>shardingemea-qw</label>
                    </labels>
                <created>Thu, 25 May 2023 14:56:25 +0000</created>
                <updated>Fri, 24 Nov 2023 16:10:15 +0000</updated>
                            <resolved>Tue, 3 Oct 2023 19:51:56 +0000</resolved>
                                    <version>6.0.6</version>
                    <version>6.3.1</version>
                    <version>5.0.18</version>
                    <version>7.0.0-rc2</version>
                                    <fixVersion>7.1.1</fixVersion>
                    <fixVersion>7.2.0-rc0</fixVersion>
                    <fixVersion>7.0.3</fixVersion>
                    <fixVersion>6.0.12</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5841251" author="xgen-internal-githook" created="Tue, 31 Oct 2023 12:37:54 +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-77479&quot; title=&quot;Sharded rename participants may incorrectly snapshot/restore pending range deletion documents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-77479&quot;&gt;&lt;del&gt;SERVER-77479&lt;/del&gt;&lt;/a&gt; Set MigrationSourceManager::_completion to an error when the migration commit/cleanup has not completed&lt;br/&gt;
Branch: v7.1&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e1177471313141260f25a007fe1d9bfbd1f2222e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e1177471313141260f25a007fe1d9bfbd1f2222e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5760080" author="xgen-internal-githook" created="Fri, 6 Oct 2023 18:30:28 +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-77479&quot; title=&quot;Sharded rename participants may incorrectly snapshot/restore pending range deletion documents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-77479&quot;&gt;&lt;del&gt;SERVER-77479&lt;/del&gt;&lt;/a&gt; Set MigrationSourceManager::_completion to an error when the migration commit/cleanup has not completed&lt;br/&gt;
Branch: v7.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/9a9d362853c1518f2aadc54224269348ff43e73c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/9a9d362853c1518f2aadc54224269348ff43e73c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5760044" author="xgen-internal-githook" created="Fri, 6 Oct 2023 18:18:49 +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-77479&quot; title=&quot;Sharded rename participants may incorrectly snapshot/restore pending range deletion documents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-77479&quot;&gt;&lt;del&gt;SERVER-77479&lt;/del&gt;&lt;/a&gt; Set MigrationSourceManager::_completion to an error when the migration commit/cleanup has not completed&lt;br/&gt;
Branch: v6.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/7d96453dd8ea852dcc6b065be19476901276a5ab&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/7d96453dd8ea852dcc6b065be19476901276a5ab&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5749499" author="xgen-internal-githook" created="Tue, 3 Oct 2023 17:49:31 +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-77479&quot; title=&quot;Sharded rename participants may incorrectly snapshot/restore pending range deletion documents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-77479&quot;&gt;&lt;del&gt;SERVER-77479&lt;/del&gt;&lt;/a&gt; Set MigrationSourceManager::_completion to an error when the migration commit/cleanup has not completed&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e009e807eba6109e493dd493ee8263f15da0d03a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e009e807eba6109e493dd493ee8263f15da0d03a&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>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25133"><![CDATA[Sharding EMEA]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26243"><![CDATA[v7.1]]></customfieldvalue>
    <customfieldvalue key="25578"><![CDATA[v7.0]]></customfieldvalue>
    <customfieldvalue key="23470"><![CDATA[v6.0]]></customfieldvalue>
    <customfieldvalue key="21777"><![CDATA[v5.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_23577" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>CAR Impact</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25718"><![CDATA[5 BF w/evergreen redness]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 3 Oct 2023 08:36:38 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        14 weeks, 1 day 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>dbeng-pm-bot</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            14 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.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|i2auuv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1t3tc:</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="7189">Sharding EMEA 2023-06-26</customfieldvalue>
    <customfieldvalue id="7190">Sharding EMEA 2023-07-10</customfieldvalue>
    <customfieldvalue id="7191">Sharding EMEA 2023-07-24</customfieldvalue>
    <customfieldvalue id="7192">Sharding EMEA 2023-08-07</customfieldvalue>
    <customfieldvalue id="7193">Sharding EMEA 2023-08-21</customfieldvalue>
    <customfieldvalue id="7194">Sharding EMEA 2023-09-04</customfieldvalue>
    <customfieldvalue id="7718">Sharding EMEA 2023-09-18</customfieldvalue>
    <customfieldvalue id="7719">Sharding EMEA 2023-10-02</customfieldvalue>
    <customfieldvalue id="7720">Sharding EMEA 2023-10-16</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</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|i2ah07:</customfieldvalue>

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