<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:08:20 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-25126] Return a different error code if the step down occurs after the write</title>
                <link>https://jira.mongodb.org/browse/SERVER-25126</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;We need to return a different error code if the step down occurs after vs before the write. NotMaster should always mean &quot;no write occurred.&quot;  We should audit and eliminate all cases where NotMaster gets returned even though a write happened.&lt;/p&gt;</description>
                <environment></environment>
        <key id="301852">SERVER-25126</key>
            <summary>Return a different error code if the step down occurs after the write</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="9">Done</resolution>
                                        <assignee username="siyuan.zhou@mongodb.com">Siyuan Zhou</assignee>
                                    <reporter username="siyuan.zhou@mongodb.com">Siyuan Zhou</reporter>
                        <labels>
                    </labels>
                <created>Mon, 18 Jul 2016 15:04:09 +0000</created>
                <updated>Tue, 16 May 2017 20:38:12 +0000</updated>
                            <resolved>Thu, 25 Aug 2016 17:35:43 +0000</resolved>
                                                    <fixVersion>3.3.12</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="1367976" author="xgen-internal-githook" created="Thu, 25 Aug 2016 17:34:35 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;visualzhou&apos;, u&apos;name&apos;: u&apos;Siyuan Zhou&apos;, u&apos;email&apos;: u&apos;siyuan.zhou@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-25126&quot; title=&quot;Return a different error code if the step down occurs after the write&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-25126&quot;&gt;&lt;del&gt;SERVER-25126&lt;/del&gt;&lt;/a&gt; Return a different error code if the step down occurs after the write&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/6b571fa314a9c5d193d362570bb58064d1d1fb0f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/6b571fa314a9c5d193d362570bb58064d1d1fb0f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1358663" author="milkie" created="Tue, 16 Aug 2016 18:01:03 +0000"  >&lt;p&gt;I think for (1) above, if NotMaster is returned, the incomplete index build is reverted, even though some writes have happened. So I think it would still be okay to return NotMaster for index builds.  For the others, I do not believe they rollback or revert any of the writes that have already happened.&lt;/p&gt;

&lt;p&gt;The code is batch_downconvert.cpp is simply propagating a NotMaster error from shard to client, without changing the circumstances of its occurrence.  So you&apos;re right, we will need to add a new case to handle the new error code that may come from a shard.&lt;/p&gt;</comment>
                            <comment id="1358534" author="siyuan.zhou@10gen.com" created="Tue, 16 Aug 2016 17:00:56 +0000"  >&lt;p&gt;Open question: NotMaster is used in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/s/write_ops/batch_downconvert.cpp#L92&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;batch_downconvert.cpp&lt;/a&gt;, shall we add another case here? CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="1358519" author="siyuan.zhou@10gen.com" created="Tue, 16 Aug 2016 16:52:56 +0000"  >&lt;p&gt;Audited all occurrences of NotMaster. Most occurrences only check primary-ship once at the beginning.&lt;/p&gt;

&lt;p&gt;1. &lt;tt&gt;CmdCreateIndex&lt;/tt&gt; checks if the node is still the primary during execution and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/create_indexes.cpp#L185&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;may return NotMaster&lt;/a&gt; several times. It seems like all checks except the first one happen after some writes.&lt;/p&gt;

&lt;p&gt;2. &lt;tt&gt;mapreduce&lt;/tt&gt; checks twice primary-ship, one in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/mr.cpp#L468&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;prepTempCollection()&lt;/a&gt;, the other in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/mr.cpp#L714&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;insert()&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;3. &lt;tt&gt;cloner&lt;/tt&gt; may &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/cloner.cpp#L282&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;return NotMaster for stepdown&lt;/a&gt; at several different stages as well.&lt;/p&gt;

&lt;p&gt;4. &lt;tt&gt;findAndModify&lt;/tt&gt; may return NotMaster at different stages when checking &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/find_and_modify.cpp#L194&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;checkCanAcceptWritesForDatabase() &lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;5. &lt;tt&gt;UpdateStage::restoreUpdateState&lt;/tt&gt; returns NotMaster &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/exec/update.cpp#L1013&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;when it&apos;s not primary on restore&lt;/a&gt;. The comment says &quot;We may have stepped down during the yield.&quot;&lt;/p&gt;

&lt;p&gt;6. In &lt;tt&gt;write_ops_exec.cpp&lt;/tt&gt;, primary-ship is checked in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/ops/write_ops_exec.cpp#L169&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;assertCanWrite_inlock()&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The plan is to change all occurrence in findAndModify, update stage, write_ops_exec.cpp and get_executor.cpp to use the new error code PrimarySteppedDown, because we&apos;ve checked the primary-ship at the beginning for every command in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/commands/dbcommands.cpp#L1376&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;dbcommands.cpp&lt;/a&gt;. For the first three commands, I&apos;ll change the return error except when it&apos;s clear no writes have happened.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="299799">SERVER-24968</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </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>2.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>Tue, 16 Aug 2016 18:01:03 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 years, 24 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_14262" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>End date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 25 Aug 2016 23:59:59 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-555</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>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 24 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>siyuan.zhou@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrk2bb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrcllz:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="1021">Repl 18 (08/05/16)</customfieldvalue>
    <customfieldvalue id="1022">Repl 2016-08-29</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_14261" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>Start date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 18 Jul 2016 00:00:00 +0000</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|hsero7:</customfieldvalue>

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