<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:08:00 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-67385] Range deletion tasks may be wrongly scheduled before ongoing queries on range finish on a shard primary</title>
                <link>https://jira.mongodb.org/browse/SERVER-67385</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b06eb97f6f440a52010eef40f1da7af5fa3a2a0f/src/mongo/db/s/collection_sharding_runtime.h#L49&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;CollectionShardingRuntime&lt;/a&gt; for a sharded collection is keeping &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b06eb97f6f440a52010eef40f1da7af5fa3a2a0f/src/mongo/db/s/collection_sharding_runtime.h#L280&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;a reference to a MetadataManager&lt;/a&gt; that is responsible to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b06eb97f6f440a52010eef40f1da7af5fa3a2a0f/src/mongo/db/s/metadata_manager.h#L247-L251&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;keep track of a list of open cursors&lt;/a&gt; to know how many queries are running using different filtering metadata for the collection at different points in time.&lt;/p&gt;

&lt;p&gt;On a shard primary node, such list is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/803e6ba5c7c4a13d9978d9adb32c68cd95f7c1e0/src/mongo/db/s/metadata_manager.cpp#L270&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;iterated when having to schedule a range deletion task&lt;/a&gt; in order to determine whether it is needed to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/803e6ba5c7c4a13d9978d9adb32c68cd95f7c1e0/src/mongo/db/s/metadata_manager.cpp#L294&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;wait for running queries&lt;/a&gt; or the task can &lt;a href=&quot;https://github.com/mongodb/mongo/blob/803e6ba5c7c4a13d9978d9adb32c68cd95f7c1e0/src/mongo/db/s/metadata_manager.cpp#L308&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;be &quot;safely&quot; scheduled&lt;/a&gt; after &lt;a href=&quot;https://www.mongodb.com/docs/v5.0/reference/parameters/#mongodb-parameter-param.orphanCleanupDelaySecs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;orphanCleanupDelaySecs&lt;/a&gt; because there are no queries acting on the orphan range.&lt;/p&gt;

&lt;p&gt;However, when filtering metadata &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b06eb97f6f440a52010eef40f1da7af5fa3a2a0f/src/mongo/db/s/collection_sharding_runtime.cpp#L244&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;are cleared up&lt;/a&gt;, the CollectionShardingRuntime is loosing track of previous metadata managers. This means that the range-deleter may not honor the promise that all running queries on the shard primary have been completed before starting deleting documents from an orphaned range.&lt;/p&gt;

&lt;p&gt;It follows that the following claim &lt;a href=&quot;https://www.mongodb.com/docs/v5.0/reference/parameters/#mongodb-parameter-param.orphanCleanupDelaySecs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;from the documentation&lt;/a&gt; has always been incorrect: &quot;Before deleting the chunk during chunk migration, MongoDB waits for orphanCleanupDelaySecs or for in-progress queries involving the chunk to complete on the shard primary, whichever is longer&quot;.&lt;/p&gt;

&lt;p&gt;This bug can be traced back to v5.0.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2072646">SERVER-67385</key>
            <summary>Range deletion tasks may be wrongly scheduled before ongoing queries on range finish on a shard primary</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.mongodb.org/images/icons/priorities/critical.svg">Critical - P2</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</assignee>
                                    <reporter username="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</reporter>
                        <labels>
                    </labels>
                <created>Mon, 20 Jun 2022 15:08:20 +0000</created>
                <updated>Sun, 29 Oct 2023 21:36:40 +0000</updated>
                            <resolved>Fri, 12 Aug 2022 12:03:11 +0000</resolved>
                                                    <fixVersion>5.0.14</fixVersion>
                    <fixVersion>6.0.2</fixVersion>
                    <fixVersion>6.1.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="4872598" author="xgen-internal-githook" created="Mon, 3 Oct 2022 13:30:44 +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-67385&quot; title=&quot;Range deletion tasks may be wrongly scheduled before ongoing queries on range finish on a shard primary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-67385&quot;&gt;&lt;del&gt;SERVER-67385&lt;/del&gt;&lt;/a&gt; Range deletion tasks on primary must not be scheduled before ongoing queries finish&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 32c2f632eaa7bf80607880162ec5e4eaeb22d7fe)&lt;br/&gt;
Branch: v5.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/834bbf20f9af79970d018594bb50ce9d98c023fb&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/834bbf20f9af79970d018594bb50ce9d98c023fb&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4759614" author="xgen-internal-githook" created="Thu, 18 Aug 2022 08:16:01 +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-67385&quot; title=&quot;Range deletion tasks may be wrongly scheduled before ongoing queries on range finish on a shard primary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-67385&quot;&gt;&lt;del&gt;SERVER-67385&lt;/del&gt;&lt;/a&gt; Range deletion tasks on primary must not be scheduled before ongoing queries finish&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 32c2f632eaa7bf80607880162ec5e4eaeb22d7fe)&lt;br/&gt;
Branch: v6.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/506c10404af0030d7fd6022ba76d34b5ad01cbae&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/506c10404af0030d7fd6022ba76d34b5ad01cbae&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4708232" author="garaudy.etienne" created="Wed, 27 Jul 2022 12:31:37 +0000"  >&lt;p&gt;I thought I had filed it! lol. It&apos;s here now. marked the docs ticket as related. DOCSP-24024&lt;/p&gt;</comment>
                            <comment id="4673335" author="garaudy.etienne" created="Tue, 12 Jul 2022 13:16:26 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=garaudy.etienne%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;garaudy.etienne@mongodb.com&quot;&gt;garaudy.etienne@mongodb.com&lt;/a&gt; to remove the &quot;or for in-progress queries involving the chunk to complete on the shard primary, whichever is longer&quot; part of the docs.&#160;&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">
                                        <issuelink>
            <issuekey id="2109347">SERVER-68660</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                        <issuelink>
            <issuekey id="2121935">SERVER-69134</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2080197">SERVER-67688</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2100457">SERVER-68352</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.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="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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 23 Jun 2022 10:14:24 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 18 weeks, 2 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, 18 weeks, 2 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>garaudy.etienne@mongodb.com</customfieldvalue>
            <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|i0zahb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0i5e8:</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_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="6395">Sharding EMEA 2022-08-22</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|i0ywmn:</customfieldvalue>

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