<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:18:21 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>[CDRIVER-3543] Consider refactoring how retryable writes labels are appended</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-3543</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;The driver adds error labels for retryable writes as part of &lt;tt&gt;_mongoc_write_error_get_type&lt;/tt&gt; per &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3462&quot; title=&quot;Expand use of error labels for RetryableWrites&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3462&quot;&gt;&lt;del&gt;CDRIVER-3462&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the review of &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3462&quot; title=&quot;Expand use of error labels for RetryableWrites&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3462&quot;&gt;&lt;del&gt;CDRIVER-3462&lt;/del&gt;&lt;/a&gt; I added some suggestions for refactoring this to be more consistent with existing code we have for adding error labels:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I wonder if it would make more sense to put this logic deeper in the command codepath.&lt;/p&gt;

&lt;p&gt;For the network error check, we could follow suit with where a&lt;br/&gt;
TransientTransactionError label is added for network errors (see &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/transactions/transactions.rst#error-reporting-changes&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/blob/master/source/transactions/transactions.rst#error-reporting-changes&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;That&apos;s in the function &quot;network_error_reply&quot; of mongoc-cluster.c. It could append a RetryableWriteError if cmd-&amp;gt;is_retryable_write is true.&lt;/p&gt;

&lt;p&gt;That would also apply in more cases, which might be an existing bug in our retry logic. Because network_reply_error is called in cases like failure to decompress a server response (&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.16.0/src/libmongoc/src/mongoc/mongoc-cluster.c/#L3013&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/blob/1.16.0/src/libmongoc/src/mongoc/mongoc-cluster.c/#L3013&lt;/a&gt;) which sets an error domain MONGOC_ERROR_PROTOCOL (not MONGOC_ERROR_STREAM) but still calls network_error_reply.&lt;/p&gt;

&lt;p&gt;For the server error check,  _mongoc_write_error_is_retryable could be moved into mongoc-cluster.c and that check could be done around here: &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.16.0/src/libmongoc/src/mongoc/mongoc-cluster.c/#L3049&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/blob/1.16.0/src/libmongoc/src/mongoc/mongoc-cluster.c/#L3049&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Though this is just a suggestion. A nice thing about adding the error label it here is that it keeps the retryable writes logic a bit more self contained. But I&apos;m up to discuss this further.&lt;/p&gt;&lt;/blockquote&gt;


</description>
                <environment></environment>
        <key id="1157160">CDRIVER-3543</key>
            <summary>Consider refactoring how retryable writes labels are appended</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="andreas.braun@mongodb.com">Andreas Braun</assignee>
                                    <reporter username="kevin.albertson@mongodb.com">Kevin Albertson</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 Feb 2020 15:40:05 +0000</created>
                <updated>Sat, 28 Oct 2023 11:28:54 +0000</updated>
                            <resolved>Wed, 26 Feb 2020 13:51:01 +0000</resolved>
                                                    <fixVersion>1.17.0-beta</fixVersion>
                    <fixVersion>1.17.0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="2910034" author="xgen-internal-githook" created="Wed, 26 Feb 2020 13:50:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andreas Braun&apos;, &apos;username&apos;: &apos;alcaeus&apos;, &apos;email&apos;: &apos;git@alcaeus.org&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-3543&quot; title=&quot;Consider refactoring how retryable writes labels are appended&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-3543&quot;&gt;&lt;del&gt;CDRIVER-3543&lt;/del&gt;&lt;/a&gt; treat certain protocol errors as retryable&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/8f62a35093c647da69a7c8dc8a6e5817b2c91f4b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/8f62a35093c647da69a7c8dc8a6e5817b2c91f4b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2907314" author="kevin.albertson" created="Tue, 25 Feb 2020 14:59:16 +0000"  >&lt;p&gt;Per discussion, I got it wrong in the description. &lt;tt&gt;network_error_reply&lt;/tt&gt; does not have the information available to know whether the write is retryable or not. And that&apos;s probably how it should be, since mongoc_cluster_run_opmsg is concerned with sending a single message and does not need to know about retryability. Instead, let&apos;s just check that the other possible network error (domain MONGOC_ERROR_PROTOCOL and code MONGOC_ERROR_PROTOCOL_INVALID_REPLY) is considered a retryable write.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hwfh6v:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>