<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:14:40 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-47600] Submitting orphan ranges during setFCV may fail if MetadataManager::_receivingChunks is not empty</title>
                <link>https://jira.mongodb.org/browse/SERVER-47600</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If MetadataManager::_receivingChunks is not empty (possibly due to a metadata refresh not occurring after a previous migration), the setFCV command can end up hitting a RangeOverlapConflict &lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/metadata_manager.cpp#L425-L429&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. Thus the setFCV gets stuck which also causes subsequent migrations to pause indefinitely.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1318110">SERVER-47600</key>
            <summary>Submitting orphan ranges during setFCV may fail if MetadataManager::_receivingChunks is not empty</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="gregory.noma@mongodb.com">Gregory Noma</assignee>
                                    <reporter username="gregory.noma@mongodb.com">Gregory Noma</reporter>
                        <labels>
                    </labels>
                <created>Thu, 16 Apr 2020 18:06:51 +0000</created>
                <updated>Sun, 29 Oct 2023 22:09:23 +0000</updated>
                            <resolved>Mon, 20 Apr 2020 18:31:18 +0000</resolved>
                                                    <fixVersion>4.4.0-rc2</fixVersion>
                    <fixVersion>4.7.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3048993" author="xgen-internal-githook" created="Tue, 21 Apr 2020 13:54:47 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Gregory Noma&apos;, &apos;email&apos;: &apos;gregory.noma@gmail.com&apos;, &apos;username&apos;: &apos;gregorynoma&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47600&quot; title=&quot;Submitting orphan ranges during setFCV may fail if MetadataManager::_receivingChunks is not empty&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47600&quot;&gt;&lt;del&gt;SERVER-47600&lt;/del&gt;&lt;/a&gt; Clear _receivingChunks on setFCV after metadata refresh&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 5943a22ad1a7bc8c8bc0a855087a9992ef4a2524)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1b18276d8c980dbe14e5f44f216d40b02904374e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1b18276d8c980dbe14e5f44f216d40b02904374e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3047673" author="xgen-internal-githook" created="Mon, 20 Apr 2020 18:27:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Gregory Noma&apos;, &apos;email&apos;: &apos;gregory.noma@gmail.com&apos;, &apos;username&apos;: &apos;gregorynoma&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47600&quot; title=&quot;Submitting orphan ranges during setFCV may fail if MetadataManager::_receivingChunks is not empty&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47600&quot;&gt;&lt;del&gt;SERVER-47600&lt;/del&gt;&lt;/a&gt; Clear _receivingChunks on setFCV after metadata refresh&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5943a22ad1a7bc8c8bc0a855087a9992ef4a2524&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5943a22ad1a7bc8c8bc0a855087a9992ef4a2524&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3043540" author="esha.maharishi@10gen.com" created="Thu, 16 Apr 2020 22:46:32 +0000"  >&lt;p&gt;&lt;b&gt;The problem:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;If a recipient finishes its end of a migration successfully, but the migration fails to commit on the config server, the range&#160; remains in the recipient&apos;s _receivingRanges. This is because the recipient&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/metadata_manager.cpp#L248-L268&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;only removes&lt;/a&gt; the range from _receivingRanges if it sees that it now owns that range. (The range would also be removed if the recipient re-received the range, because&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/migration_destination_manager.cpp#L909&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MigrationDestinationManager::_migrateDriver&lt;/a&gt; -&amp;gt;&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/migration_destination_manager.cpp#L1394&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MigrationDestinationManager::_notePending&lt;/a&gt; -&amp;gt;&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/collection_sharding_runtime.cpp#L235&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;CollectionShardingRuntime::beginReceive&lt;/a&gt; -&amp;gt;&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/metadata_manager.cpp#L367&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MetadataManager::beginReceive&lt;/a&gt; would emplace the same range in _receivingChunks and continue with that second migration. If the second migration succeeded, the range would be removed from the recipient&apos;s _receivingRanges when the recipient refreshed after the second migration&apos;s commit.)&lt;/p&gt;

&lt;p&gt;If setFCV&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/commands/set_feature_compatibility_version_command.cpp#L261&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;inserts a range deletion task for the range&lt;/a&gt; (or an overlapping range) while the range is stuck in _receivingRanges after a failed migration commit, processing the range deletion task will &lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/metadata_manager.cpp#L425-L429&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;fail with RangeOverlapConflict&lt;/a&gt;. At that point, a second migration will block waiting for the range deletion task to be processed.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Potential solutions:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;setFCV has a special property that the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/migration_util.cpp#L407&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;refresh&lt;/a&gt; a shard does as part of the setFCV&apos;s &lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/migration_util.cpp#L450&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;submitOrphanRangesForCleanup&lt;/a&gt; is guaranteed to be at or after the time the config server wrote that it was starting to upgrade its FCV. This is because the config server sends setFCV to all shards and gossips its configOpTime on all messages, and shards refresh with an afterOpTime of the latest configOpTime they know about.&lt;/p&gt;

&lt;p&gt;Since any migration that had not committed by the time the setFCV began on the config server will not be able to commit afterwards*, the shard can safely assume that after it refreshes as part of setFCV, the set of ranges it owns will not change.&lt;/p&gt;

&lt;p&gt;We can exploit this to ensure the range deletion task for setFCV is able to complete successfully even if there is a range stuck in _receivingRanges by:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Making a&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/migration_util.cpp#L418-L431&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;range deletion task written by setFCV&lt;/a&gt; and therefore&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/shard_server_op_observer.cpp#L280&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;submitted for processing through the OpObserver&lt;/a&gt; not check _receivingRanges&lt;/li&gt;
	&lt;li&gt;Making setFCV clear _receivingRanges after&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/71e579bae08460741bd8169eac38a8eded284543/src/mongo/db/s/migration_util.cpp#L407&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the refresh&lt;/a&gt; but before writing the range deletion task&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;*I remember why we had decided not to clear _receivingRanges on setFCV. It&apos;s because a migration commit could succeed if the FCV was upgraded and then downgraded.Then the recipient would officially own the chunk, but would have deleted the chunk&apos;s data. I think this is too unlikely a scenario to really worry about, though. People probably do not setFCV to upgrade and then setFCV to downgrade quickly enough for this to happen in practice.&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>3.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="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>Thu, 16 Apr 2020 22:46:32 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 42 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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 42 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>50.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>esha.maharishi@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>gregory.noma@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxfte7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hwunt3:</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="3841">Sharding 2020-05-04</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;The generated tests can be downloaded &lt;a href=&quot;https://evergreen.mongodb.com/task/mongodb_mongo_v4.4_enterprise_rhel_62_64_bit_majority_read_concern_off_display_jstestfuzz_concurrent_sharded_causal_consistency_656ee188b8db0c2ed0e00652ec1c0c47b964a795_20_04_14_12_26_42&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. Running jstestfuzz-d133-ent_b819-qa_a6ce-1586874860847-0.js and jstestfuzz-d133-ent_b819-qa_a6ce-1586874860847-1.js (in that order) together in the same resmoke invocation should cause a hang.&lt;/p&gt;</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|hxffnj:</customfieldvalue>

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