<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:43:12 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-57953] _flushReshardingStateChange attempts to refresh shard version while another refresh already pending, leading to invariant failure</title>
                <link>https://jira.mongodb.org/browse/SERVER-57953</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The &amp;#95;flushReshardingStateChange command doesn&apos;t attempt to join with any earlier running shard version refreshes. It was believed for this to be safe due to shard version refreshes not being possible while the critical section is held. However, it is possible for an earlier &amp;#95;flushReshardingStateChange command that had been interrupted by stepdown &lt;a href=&quot;https://github.com/mongodb/mongo/blob/da173c4995cd000da3d585c254f681f13edd0b2c/src/mongo/db/s/resharding/resharding_donor_recipient_common.cpp#L384-L385&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;to have called CollectionShardingRuntime::setShardVersionRecoverRefreshFuture()&lt;/a&gt; and for the RecoverRefreshThread to not yet have finished running the shard version refresh where &lt;a href=&quot;https://github.com/mongodb/mongo/blob/3befdc7d70fa56085bbdc9606da0db84b5b48ccd/src/mongo/db/s/shard_filtering_metadata_refresh.cpp#L176&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the RecoverRefreshThread would have called CollectionShardingRuntime::resetShardVersionRecoverRefreshFuture()&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This leads the &amp;#95;flushReshardingStateChange command to hit &lt;a href=&quot;https://github.com/mongodb/mongo/blob/da173c4995cd000da3d585c254f681f13edd0b2c/src/mongo/db/s/collection_sharding_runtime.cpp#L400&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this invariant in CollectionShardingRuntime::setShardVersionRecoverRefreshFuture()&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Proposed solution: Rather than attempting to make the &amp;#95;flushReshardingStateChange command attempt to join with a shard version refresh triggered by any earlier instances of the command, we could instead introduce a new &amp;#95;shardsvrCommitReshardCollection command analogous to the &amp;#95;shardsvrAbortReshardCollection command introduced in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56638&quot; title=&quot;Fix flushReshardingStateChanges critical section race&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-56638&quot;&gt;&lt;del&gt;SERVER-56638&lt;/del&gt;&lt;/a&gt;. The &amp;#95;shardsvrCommitReshardCollection would&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Call &amp;#95;coordinatorHasDecisionPersisted.emplaceValue().&lt;/li&gt;
	&lt;li&gt;Wait on DonorStateMachine::getCompletionFuture() and RecipientStateMachine::getCompletionFuture().&lt;/li&gt;
	&lt;li&gt;Wait for the latest optime to become majority-committed.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;With the proposed &amp;#95;shardsvrCommitReshardCollection command, DonorStateMachine and RecipientStateMachine would additionally need to be changed to call CollectionShardingRuntime::clearFilteringMetadata() prior to releasing the critical section. This is needed to guarantee that a stale mongos cannot get a response of &quot;no documents&quot; after the donor shard has dropped the original collection and would instead be told to refresh its shard version. DonorStateMachine and RecipientStateMachine should additionally call onShardVersionMismatch() after releasing the critical section to eagerly refresh their shard version and learn of the new collection epoch before the first operation for the namespace being resharded comes in.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1792904">SERVER-57953</key>
            <summary>_flushReshardingStateChange attempts to refresh shard version while another refresh already pending, leading to invariant failure</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="blake.oler@mongodb.com">Blake Oler</assignee>
                                    <reporter username="max.hirschhorn@mongodb.com">Max Hirschhorn</reporter>
                        <labels>
                            <label>PM-234-M3</label>
                            <label>PM-234-T-lifecycle</label>
                    </labels>
                <created>Tue, 22 Jun 2021 16:44:42 +0000</created>
                <updated>Sun, 29 Oct 2023 21:51:46 +0000</updated>
                            <resolved>Thu, 8 Jul 2021 17:12:59 +0000</resolved>
                                                    <fixVersion>5.0.3</fixVersion>
                    <fixVersion>5.1.0-rc0</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="4106756" author="JIRAUSER1259052" created="Wed, 6 Oct 2021 18:08:00 +0000"  >&lt;p&gt;Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it&#8217;s been triggered. For more active release information, please keep an eye on #server-release. Thank you!&lt;/p&gt;</comment>
                            <comment id="3986331" author="xgen-internal-githook" created="Fri, 6 Aug 2021 20:39:56 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Blake Oler&apos;, &apos;email&apos;: &apos;blake.oler@mongodb.com&apos;, &apos;username&apos;: &apos;BlakeIsBlake&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-57953&quot; title=&quot;_flushReshardingStateChange attempts to refresh shard version while another refresh already pending, leading to invariant failure&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-57953&quot;&gt;&lt;del&gt;SERVER-57953&lt;/del&gt;&lt;/a&gt; Change existing participant machines to allow directly calling commit&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 7f54d6c00e647eac55e70debf4240a17f6eabb7a)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-57953&quot; title=&quot;_flushReshardingStateChange attempts to refresh shard version while another refresh already pending, leading to invariant failure&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-57953&quot;&gt;&lt;del&gt;SERVER-57953&lt;/del&gt;&lt;/a&gt; Thread calls to setFilteringMetadata inside the resharding participant machines&lt;/p&gt;

&lt;p&gt;(cherry picked from commit a29714ffc0ae3b70242a3665121748da360686ba)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-57953&quot; title=&quot;_flushReshardingStateChange attempts to refresh shard version while another refresh already pending, leading to invariant failure&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-57953&quot;&gt;&lt;del&gt;SERVER-57953&lt;/del&gt;&lt;/a&gt; Call _shardsvrCommitReshardCollection command&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 1bbe9d4fba13374a7fe017bd4d5853c81ee39340)&lt;br/&gt;
Branch: v5.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/d2e7cbc02e618889f2d56bffbc021bbb78573d72&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/d2e7cbc02e618889f2d56bffbc021bbb78573d72&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3923017" author="xgen-internal-githook" created="Thu, 8 Jul 2021 14:51:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Blake Oler&apos;, &apos;email&apos;: &apos;blake.oler@mongodb.com&apos;, &apos;username&apos;: &apos;BlakeIsBlake&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-57953&quot; title=&quot;_flushReshardingStateChange attempts to refresh shard version while another refresh already pending, leading to invariant failure&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-57953&quot;&gt;&lt;del&gt;SERVER-57953&lt;/del&gt;&lt;/a&gt; Call _shardsvrCommitReshardCollection command&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1bbe9d4fba13374a7fe017bd4d5853c81ee39340&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1bbe9d4fba13374a7fe017bd4d5853c81ee39340&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3918504" author="xgen-internal-githook" created="Tue, 6 Jul 2021 16:51:10 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Blake Oler&apos;, &apos;email&apos;: &apos;blake.oler@mongodb.com&apos;, &apos;username&apos;: &apos;BlakeIsBlake&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-57953&quot; title=&quot;_flushReshardingStateChange attempts to refresh shard version while another refresh already pending, leading to invariant failure&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-57953&quot;&gt;&lt;del&gt;SERVER-57953&lt;/del&gt;&lt;/a&gt; Thread calls to setFilteringMetadata inside the resharding participant machines&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/a29714ffc0ae3b70242a3665121748da360686ba&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/a29714ffc0ae3b70242a3665121748da360686ba&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3906136" author="xgen-internal-githook" created="Mon, 28 Jun 2021 20:45:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Blake Oler&apos;, &apos;email&apos;: &apos;blake.oler@mongodb.com&apos;, &apos;username&apos;: &apos;BlakeIsBlake&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-57953&quot; title=&quot;_flushReshardingStateChange attempts to refresh shard version while another refresh already pending, leading to invariant failure&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-57953&quot;&gt;&lt;del&gt;SERVER-57953&lt;/del&gt;&lt;/a&gt; Change existing participant machines to allow directly calling commit&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/7f54d6c00e647eac55e70debf4240a17f6eabb7a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/7f54d6c00e647eac55e70debf4240a17f6eabb7a&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">
                                        <issuelink>
            <issuekey id="1811271">SERVER-58343</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1796517">SERVER-58063</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1701071">SERVER-56638</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1792903">SERVER-57952</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>5.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="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>Mon, 28 Jun 2021 20:45:52 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 18 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-234</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 18 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>134.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>blake.oler@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
            <customfieldvalue>vivian.ge@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hznutr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hz8bwn:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="4521">Sharding 2021-07-12</customfieldvalue>

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

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