<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:16:11 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-70437] Lost writes to unsharded collection during movePrimary</title>
                <link>https://jira.mongodb.org/browse/SERVER-70437</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Consider the following interleaving:&lt;/p&gt;

&lt;p&gt;1. &#160;&lt;span class=&quot;error&quot;&gt;&amp;#91;th1&amp;#93;&lt;/span&gt; Starts a multi write operation on an unsharded collection and passes the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b5e4ebac34b7ef82989ab6f6230943e362b2ffc9/src/mongo/db/catalog_raii.cpp#L182&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;dbVersion check&lt;/a&gt; successfully.&lt;br/&gt;
2. &lt;span class=&quot;error&quot;&gt;&amp;#91;th1&amp;#93;&lt;/span&gt; The multi write yields.&lt;br/&gt;
3. &lt;span class=&quot;error&quot;&gt;&amp;#91;th2&amp;#93;&lt;/span&gt; A movePrimary starts and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/2b21e66449b49f3c5ee5fc076a00708d45c197dd/src/mongo/db/s/move_primary_source_manager.cpp#L110&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;sets the &apos;move primary in progress&apos; flag on the DatabaseShardingState.&lt;/a&gt;&lt;br/&gt;
4. &lt;span class=&quot;error&quot;&gt;&amp;#91;th2&amp;#93;&lt;/span&gt; MovePrimary commits.&lt;br/&gt;
5. &lt;span class=&quot;error&quot;&gt;&amp;#91;th2&amp;#93;&lt;/span&gt; MovePrimary &lt;a href=&quot;https://github.com/mongodb/mongo/blob/2b21e66449b49f3c5ee5fc076a00708d45c197dd/src/mongo/db/s/move_primary_source_manager.cpp#L510-L511&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;unsets the &apos;move primary in progress&apos;&lt;/a&gt;&lt;br/&gt;
6. &lt;span class=&quot;error&quot;&gt;&amp;#91;th2&amp;#93;&lt;/span&gt; MovePrimary hangs before &lt;a href=&quot;https://github.com/mongodb/mongo/blob/2b21e66449b49f3c5ee5fc076a00708d45c197dd/src/mongo/db/s/move_primary_coordinator.cpp#L112&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;dropping the old collection from the former primary&lt;/a&gt;.&lt;br/&gt;
7. &lt;span class=&quot;error&quot;&gt;&amp;#91;th1&amp;#93;&lt;/span&gt; The multi write now resumes from the yield. Note how the writes never recheck the dbVersion on the op_observers (like we &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b5e4ebac34b7ef82989ab6f6230943e362b2ffc9/src/mongo/db/s/op_observer_sharding_impl.cpp#L200&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;do for the &apos;shardVersion&apos;&lt;/a&gt;). Therefore, &lt;b&gt;the writes don&apos;t fail, but are lost&lt;/b&gt; because they happened on the old db-primary shard after the ownership change had already committed.&lt;/p&gt;

&lt;p&gt;Note that on the op_observer we fail writes if there&apos;s a move primary operation in progress. This is what typically prevents losing writes. However, this is only hit if the write restores from yield while the movePrimary is still in progress. In the interleaving above, this does not happen. I don&apos;t think this interleaving is very likely, since it requires that the write was yielded for a long time (&lt;a href=&quot;https://github.com/mongodb/mongo/blob/2b21e66449b49f3c5ee5fc076a00708d45c197dd/src/mongo/db/s/move_primary_coordinator.cpp#L109-L111&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;from the moment the cloning started until after the commit happened&lt;/a&gt;).&lt;/p&gt;</description>
                <environment></environment>
        <key id="2156312">SERVER-70437</key>
            <summary>Lost writes to unsharded collection during movePrimary</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="daniel.gomezferro@mongodb.com">Daniel Gomez Ferro</assignee>
                                    <reporter username="jordi.serra-torrens@mongodb.com">Jordi Serra Torrens</reporter>
                        <labels>
                    </labels>
                <created>Tue, 11 Oct 2022 09:50:29 +0000</created>
                <updated>Sun, 29 Oct 2023 21:32:04 +0000</updated>
                            <resolved>Tue, 3 Jan 2023 14:09:02 +0000</resolved>
                                    <version>4.4.0</version>
                    <version>5.0.0</version>
                    <version>6.0.0</version>
                                    <fixVersion>6.3.0-rc0</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5075119" author="xgen-internal-githook" created="Fri, 23 Dec 2022 17:45:28 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Daniel G&#243;mez Ferro&apos;, &apos;email&apos;: &apos;daniel.gomezferro@mongodb.com&apos;, &apos;username&apos;: &apos;dgomezferro&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-70437&quot; title=&quot;Lost writes to unsharded collection during movePrimary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-70437&quot;&gt;&lt;del&gt;SERVER-70437&lt;/del&gt;&lt;/a&gt; Check dbVersion on sharding opobservers&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/0323cbd6a51391da9f78a43831a78185027fc12c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/0323cbd6a51391da9f78a43831a78185027fc12c&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                        <issuelink>
            <issuekey id="2427963">SERVER-80463</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="407514" name="0001-Repro-SERVER-70437.patch" size="5275" author="jordi.serra-torrens@mongodb.com" created="Tue, 11 Oct 2022 09:52:01 +0000"/>
                    </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_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.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, 1 Dec 2022 14:32:33 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 6 weeks, 5 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-2144</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, 6 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>35.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>daniel.gomezferro@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>jordi.serra-torrens@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i1dlbr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0w9go:</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_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="6492">Execution Team 2022-11-14</customfieldvalue>
    <customfieldvalue id="6554">Execution Team 2022-12-12</customfieldvalue>
    <customfieldvalue id="6579">Execution Team 2022-11-28</customfieldvalue>
    <customfieldvalue id="6672">Execution Team 2022-12-26</customfieldvalue>
    <customfieldvalue id="6673">Execution Team 2023-01-09</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|i1d7h3:</customfieldvalue>

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