<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:13:59 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-47371] Chunk migration concurrent with multi-delete can cause matching documents to not be deleted</title>
                <link>https://jira.mongodb.org/browse/SERVER-47371</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Observed in mr_output_options.js where &lt;tt&gt;coll.remove({})&lt;/tt&gt; completed successfully, but then &lt;tt&gt;coll.find().itcount() != 0&lt;/tt&gt; (with no concurrent inserts).  This is in contrast to running &lt;tt&gt;coll.remove({})&lt;/tt&gt; on a standalone or replica set, or on a sharded cluster in the absence of a concurrent chunk migration.&lt;/p&gt;

&lt;p&gt;Sequence of events is:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Start chunk migration from shardA to shardB.
&lt;br class=&quot;atl-forced-newline&quot; /&gt; &lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;After the range deletion on the recipient (shardB), but before the clone starts, the mongos gets &lt;tt&gt;coll.remove({})&lt;/tt&gt;, and broadcasts it unversioned to both shards.
&lt;br class=&quot;atl-forced-newline&quot; /&gt; &lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;shardB finishes that deletion quickly.  shardB now has 0 documents in &lt;tt&gt;coll&lt;/tt&gt;.
&lt;br class=&quot;atl-forced-newline&quot; /&gt; &lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;Meanwhile, shardA has started processing the multi-delete, but is working on other documents, not those in the chunk range being moved.
&lt;br class=&quot;atl-forced-newline&quot; /&gt; &lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;Now the clone of documents from shardA to shardB happens (starts and completes).  shardB now has non-zero documents (the contents of the chunk being moved).
&lt;br class=&quot;atl-forced-newline&quot; /&gt; &lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;The migration enters the critical section to commit, interrupting the multi-delete on shardA with StaleConfig &quot;migration commit in progress for dbname.collname&quot;.
&lt;br class=&quot;atl-forced-newline&quot; /&gt; &lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;The migration gets the final xfermods from the donor&apos;s OpObsever inside the critical section, but because the multi-delete on shardA hasn&apos;t yet gotten to any of the chunk range documents, there are no mods to apply.  The migration finishes normally.
&lt;br class=&quot;atl-forced-newline&quot; /&gt; &lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/li&gt;
	&lt;li&gt;In the meantime, the mongos received StaleConfig from the multi-delete on shardA, so it has resent the multi-delete but only to shardA.  It blocks until the critical section exits, then runs normally to successful completion.  The mongos multi-delete command now also completes successfully.  shardA now has 0 documents, but shardB still has the documents from the migrated chunk.&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment></environment>
        <key id="1306173">SERVER-47371</key>
            <summary>Chunk migration concurrent with multi-delete can cause matching documents to not be deleted</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-server-cluster-scalability">Backlog - Cluster Scalability</assignee>
                                    <reporter username="kevin.pulo@mongodb.com">Kevin Pulo</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Apr 2020 21:20:11 +0000</created>
                <updated>Tue, 12 Dec 2023 15:58:59 +0000</updated>
                                                                            <component>Querying</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="3658568" author="JIRAUSER1259007" created="Thu, 11 Mar 2021 08:50:26 +0000"  >&lt;p&gt;Hello!&lt;br/&gt;
 We&apos;re facing similar issue when updating shard key values in document. First during bulk replace some of the documents are failed to replace, because this update will cause document&apos;s migration to another shard. Then we retry all failed replace operation with replaceOne command and sometimes they may also fail with error &quot;Update operation was converted into a distributed transaction because the document being updated would move shards and that transaction failed. :: caused by :: Encountered error from &amp;lt;host&amp;gt;:&amp;lt;port&amp;gt; during a transaction :: caused by :: migration commit in progress for &amp;lt;dbname&amp;gt;.&amp;lt;collname&amp;gt;&quot;.&lt;/p&gt;

&lt;p&gt;Is there any workaround for the last mentioned error? I saw that in commit for parent issue that balancer was turned off, is it a valid fix?&lt;/p&gt;

&lt;p&gt;We&apos;re using mongo 4.4 with 3 shards, each consists of 3 mongod.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1155274">SERVER-46211</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>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26583"><![CDATA[Cluster Scalability]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 11 Mar 2021 08:50:26 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 47 weeks, 6 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_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>dbeng-pm-bot</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 47 weeks, 6 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>alexey.maltsev@infobip.com</customfieldvalue>
            <customfieldvalue>backlog-server-cluster-scalability</customfieldvalue>
            <customfieldvalue>kevin.pulo@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxdt8v:</customfieldvalue>

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

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