<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:05:08 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-24012] Clean up WriteConcernErrorDetail class and use it instead of a Status where appropriate</title>
                <link>https://jira.mongodb.org/browse/SERVER-24012</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/dd717c8cb6b897a1769fc320734d5d0eb538ce80/src/mongo/rpc/get_status_from_command_result.cpp#L81&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;getWriteConcernStatusFromCommandResult&lt;/a&gt; function returns a Status, but that loses some information includes in a write concern response, such as the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/dd717c8cb6b897a1769fc320734d5d0eb538ce80/src/mongo/rpc/write_concern_error_detail.h#L72&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&apos;errInfo&apos;&lt;/a&gt; field.&lt;/p&gt;

&lt;p&gt;We should make WriteConcernErrorDetail easier to construct and parse from BSON, then use it anywhere we deal with write concern error responses (such as in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/dd717c8cb6b897a1769fc320734d5d0eb538ce80/src/mongo/s/client/shard.h#L71&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Shard::CommandResponse&lt;/a&gt;)&lt;/p&gt;</description>
                <environment></environment>
        <key id="283889">SERVER-24012</key>
            <summary>Clean up WriteConcernErrorDetail class and use it instead of a Status where appropriate</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="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-repl">Backlog - Replication Team</assignee>
                                    <reporter username="spencer@mongodb.com">Spencer Brody</reporter>
                        <labels>
                            <label>ds-neweng-2016</label>
                            <label>neweng</label>
                            <label>writeconcern</label>
                    </labels>
                <created>Mon, 2 May 2016 20:12:30 +0000</created>
                <updated>Tue, 6 Dec 2022 04:26:31 +0000</updated>
                                                                            <component>Replication</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1448215" author="william.schultz" created="Fri, 2 Dec 2016 20:47:29 +0000"  >&lt;p&gt;&lt;em&gt;After some investigation, the following is a suggested aid/approach to resolving this ticket&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Normal database commands that cause an error will return result objects with the fields&lt;/p&gt;

&lt;p&gt;{&lt;tt&gt;ok: int, code:int, errmsg: string&lt;/tt&gt;}&lt;/p&gt;

&lt;p&gt;Note that we have existing logic to interpret normal command result objects as Status objects (&lt;tt&gt;src/mongo/base/status.h&lt;/tt&gt;) in &lt;tt&gt;get_status_from_command_result.cpp&lt;/tt&gt;.  &lt;/p&gt;

&lt;p&gt;WriteConcernError objects, which appear in the field &apos;writeConcernError&apos; of command result objects, take on the form&lt;/p&gt;

&lt;p&gt;{&lt;tt&gt;code: int, errmsg: string,  errInfo: Object&lt;/tt&gt;}&lt;/p&gt;

&lt;p&gt;Since this object has a &apos;code&apos; and an &apos;errmsg&apos; field, it can really just be interpreted as a normal Status, of the error kind, with one extra piece of information (&lt;tt&gt;errInfo&lt;/tt&gt;). I would recommend factoring out the common parsing logic for &quot;status-like&quot; objects in &lt;tt&gt;get_status_from_command_result.cpp&lt;/tt&gt;, and perhaps let the WriteConcernErrorDetail class contain a Status object as a member, and one additional &apos;errInfo&apos; member. &lt;/p&gt;

&lt;p&gt;The core idea here is to interpret writeConcernError objects as Status objects, with a bit of extra metadata. This was motivated by the recognition that parsing BSON with proper error handling is not so clean to do in the C++ codebase, so it would be nice to consolidate it as much as possible. Additionally, it simplifies things by not tacking on unnecessarily complicated semantics to the WriteConcernErrorDetail class, when it essentially inherits the same core properties as a normal Status object.&lt;/p&gt;
</comment>
                            <comment id="1304888" author="spencer" created="Thu, 23 Jun 2016 21:38:32 +0000"  >&lt;p&gt;There are places currently, such as &lt;a href=&quot;https://github.com/mongodb/mongo/blob/dd717c8cb6b897a1769fc320734d5d0eb538ce80/src/mongo/s/catalog/replset/sharding_catalog_client_impl.cpp#L1136&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ShardingCatalogClientImpl::runUserManagementWriteCommand&lt;/a&gt; where we lose the &apos;errInfo&apos; object in the response that we return to the user, where making this change would allow us to report that information to the user correctly.&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>2.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_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25128"><![CDATA[Replication]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 18 Nov 2016 22:06:54 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 years, 10 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_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>
                            7 years, 10 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-repl</customfieldvalue>
            <customfieldvalue>spencer@mongodb.com</customfieldvalue>
            <customfieldvalue>william.schultz@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrk8rz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrc1tz:</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="1014">Sharding 16 (06/24/16)</customfieldvalue>
    <customfieldvalue id="1310">Repl 2016-11-21</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|hsez7r:</customfieldvalue>

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