<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:04:29 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-23790] in ShardRegistry&apos;s runCommand, make commands that fail with a non-retryable error return immediately</title>
                <link>https://jira.mongodb.org/browse/SERVER-23790</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently, if a command fails with a non-retriable error, we check for write concern errors and potentially return a write concern error status that overrides the command error status:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/bdc06761206ac398af04f0a2eb482c4dca49bad8/src/mongo/s/client/shard_registry.cpp#L779-L786&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/bdc06761206ac398af04f0a2eb482c4dca49bad8/src/mongo/s/client/shard_registry.cpp#L779-L786&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is non-trivial to untangle the way we handle the different types of errors, which can be due to request failure, command failure, or write concern failure, for a few reasons:&lt;/p&gt;

&lt;p&gt;----- Issue 1 -----&lt;/p&gt;

&lt;p&gt;If a write concern error is present in the command response, it is converted to a WriteConcernFailed error, regardless of what kind of write concern error it was:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/bdc06761206ac398af04f0a2eb482c4dca49bad8/src/mongo/s/client/shard_registry.cpp#L135-L141&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/bdc06761206ac398af04f0a2eb482c4dca49bad8/src/mongo/s/client/shard_registry.cpp#L135-L141&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;WriteConcernFailed is part of kAllRetriableErrors, but other types of write concern errors are not:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/bdc06761206ac398af04f0a2eb482c4dca49bad8/src/mongo/s/client/shard_registry.cpp#L153-L170&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/bdc06761206ac398af04f0a2eb482c4dca49bad8/src/mongo/s/client/shard_registry.cpp#L153-L170&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;---- Issue 2 ----&lt;/p&gt;

&lt;p&gt;The jstests that check for write concern error behavior, such as&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/jstests/sharding/commands_that_write_accept_wc_configRS.js&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;commands_that_write_accept_wc_configRS.js&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;expect the client to see a command error (ok: 0) on even non-WriteConcernFailed write concern errors, which currently works because:&lt;/p&gt;

&lt;p&gt;1) the non-WriteConcernFailed write concern error is returned and converted into WriteConcernFailed&lt;br/&gt;
2) since WriteConcernFailed is retriable, the command is retried&lt;br/&gt;
3) the command now fails because it previously succeeded (for example, dropCollection fails with NamespaceNotFound), but with a non-retriable error&lt;br/&gt;
4) since the error is non-retriable, we check the write concern detail&lt;br/&gt;
5) the non-WriteConcernFailed write concern error is returned as an error status&lt;br/&gt;
6) the test succeeds since it sees a command error&lt;/p&gt;

&lt;p&gt;It would be better for non-WriteConcernFailed write concern errors to be returned as part of the write concern detail, and for the test to check for them there instead of checking if the command failed.&lt;/p&gt;

&lt;p&gt;---- Issue 3 ----&lt;/p&gt;

&lt;p&gt;Higher up error handling code expects non-retriable errors to be returned within the command response (they call getStatusFromCommandResult() themselves), but retriable errors to be returned as an error status.&lt;/p&gt;

&lt;p&gt;Either the higher up error handling code should be unified to handle retriable and non-retriable errors the same way, or the code in ShardRegistry&apos;s runCommand should return the command response on non-retriable errors but an error status on retriable errors (when you&apos;re out of retries).&lt;/p&gt;</description>
                <environment></environment>
        <key id="280612">SERVER-23790</key>
            <summary>in ShardRegistry&apos;s runCommand, make commands that fail with a non-retryable error return immediately</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="spencer@mongodb.com">Spencer Brody</assignee>
                                    <reporter username="esha.maharishi@mongodb.com">Esha Maharishi</reporter>
                        <labels>
                    </labels>
                <created>Mon, 18 Apr 2016 21:08:46 +0000</created>
                <updated>Thu, 8 Jun 2017 12:46:12 +0000</updated>
                            <resolved>Wed, 27 Apr 2016 19:20:25 +0000</resolved>
                                    <version>3.3.4</version>
                                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1248272" author="spencer" created="Wed, 27 Apr 2016 19:20:25 +0000"  >&lt;p&gt;Rather than fixing ShardRegistry::runCommand&apos;s behavior, just going to remove all callers of it and switch to calling Shard::runCommand instead, which has the right behavior.&lt;/p&gt;</comment>
                    </comments>
                    <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_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 27 Apr 2016 19:20:25 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 years, 42 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-550</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>jesse@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 42 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
            <customfieldvalue>spencer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrka0n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrd6j3:</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="896">Sharding 13 (04/22/16)</customfieldvalue>
    <customfieldvalue id="902">Sharding 14 (05/13/16)</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|hsbubb:</customfieldvalue>

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