<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:37:39 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-55852] Shards first acquire LockManager locks before reacting to abortReshardCollection</title>
                <link>https://jira.mongodb.org/browse/SERVER-55852</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The abortReshardCollection command triggers a shard to refresh using the &amp;#95;flushReshardingStateChange command. &lt;a href=&quot;https://github.com/mongodb/mongo/blob/85fdfd2d8e3302f48efe2e179de39843ccf5c6e6/src/mongo/db/s/flush_resharding_state_change_command.cpp#L65-L75&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;The &amp;#95;flushReshardingStateChange command first acquires a database and collection lock&lt;/a&gt; to check whether the critical section is held and again acquires these locks as part of onShardVersionMismatch() if the critical section wasn&apos;t held. These lock acquisitions can block if the shard has enqueued a strong lock. However, writes being stalled by the strong lock may be the motivation for the user having run abortReshardCollection in the first place. The abortReshardCollection command waiting for a strong lock request to be granted + released means an end&amp;#45;user would need to additionally run killOp on operations from internal (system) threads to have the server make forward progress, which undermines the utility of the abortReshardCollection command.&lt;/p&gt;

&lt;p&gt;We should instead have an explicit {&amp;#95;shardsvrAbortReshardCollection: &amp;lt;reshardingUUID&amp;gt;} command that interacts with the DonorStateMachines and RecipientStateMachines directly. Note that the coordinator&apos;s decision is irreversible so &apos;pushing&apos; out the decision as opposed to having the participant shards &apos;pulling&apos; it via a shard version refresh is still safe in presence of delayed messages.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1672465">SERVER-55852</key>
            <summary>Shards first acquire LockManager locks before reacting to abortReshardCollection</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="3">Duplicate</resolution>
                                        <assignee username="backlog-server-sharding-nyc">[DO NOT USE] Backlog - Sharding NYC</assignee>
                                    <reporter username="max.hirschhorn@mongodb.com">Max Hirschhorn</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Apr 2021 01:24:26 +0000</created>
                <updated>Tue, 6 Dec 2022 01:26:51 +0000</updated>
                            <resolved>Mon, 24 May 2021 13:22:21 +0000</resolved>
                                                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="3817665" author="max.hirschhorn@10gen.com" created="Mon, 24 May 2021 13:22:21 +0000"  >&lt;p&gt;The new &amp;#95;shardsvrAbortReshardCollection command no longer acquires locks before canceling the abortToken for the DonorStateMachines and RecipientStateMachines.&lt;/p&gt;</comment>
                            <comment id="3756793" author="max.hirschhorn@10gen.com" created="Wed, 5 May 2021 16:21:51 +0000"  >&lt;p&gt;Cross&amp;#45;posting my comment from &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; because the two issues can be addressed with the same code changes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I think to address both &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; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-55852&quot; title=&quot;Shards first acquire LockManager locks before reacting to abortReshardCollection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-55852&quot;&gt;&lt;del&gt;SERVER-55852&lt;/del&gt;&lt;/a&gt; we should introduce an explicit &amp;#95;shardsvrAbortReshardCollection that the resharding coordinator sends to abort the resharding operation (rather than the generic &amp;#95;flushReshardingStateChange). The {&amp;#95;shardsvrAbortReshardCollection: &amp;lt;reshardingUUID&amp;gt;} command would call new DonorStateMachine::abort() and RecipientStateMachine::abort() methods to cancel their &lt;tt&gt;&amp;#95;abortSource&lt;/tt&gt;. In particular, the resharding coordinator actively aborting a resharding operation would not depend in any way on the ability to complete a shard version refresh.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;The &amp;#95;shardsvrAbortReshardCollection command must check for both a DonorStateMachine and a RecipientStateMachine to call abort() on.&lt;/li&gt;
	&lt;li&gt;It isn&apos;t an error if &amp;#95;shardsvrAbortReshardCollection finds neither a DonorStateMachine nor a RecipientStateMachine. This is because it is possible for there to have been a delayed message where the donor and/or recipient has already exited by the time the &amp;#95;shardsvrAbortReshardCollection is being processed. Similarly, the abort() method must allow being called multiple times.&lt;/li&gt;
	&lt;li&gt;The &amp;#95;shardsvrAbortReshardCollection command must wait for the donor + recipient to have transitioned to kDone and for that local write to have become majority&amp;#45;committed. (It doesn&apos;t need to wait for the donor/recipient to have updated the config.reshardingOperations collection on the config server though.) The reasoning here is two&amp;#45;fold:
	&lt;ol&gt;
		&lt;li&gt;Performing a write and waiting for it to be majority&amp;#45;committed after having called the abort() method(s) ensures the resharding coordinator has contacted a current primary.&lt;/li&gt;
		&lt;li&gt;Step&amp;#45;up will continue to trigger a shard version refresh and may discover the resharding operation has been aborted. However, the race described 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; will continue to exist for that scenario and may lead to the shard version refresh becoming stuck. Requiring the resharding coordinator wait for the donor/recipient to have persisted its acknowledgment of the abort signal guarantees that the resharding coordinator would be separately sending (and continually retrying) the &amp;#95;shardsvrAbortReshardCollection command in any cases where the shard version refresh could get stuck.&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-56638?focusedCommentId=3756789&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-3756789&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-56638?focusedCommentId=3756789&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-3756789&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="1701071">SERVER-56638</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1561207">SERVER-53258</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1620808">SERVER-54474</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>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25134"><![CDATA[Sharding NYC]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 37 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_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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 37 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>backlog-server-sharding-nyc</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hz3hif:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyok3r:</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_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|hz33rj:</customfieldvalue>

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