<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:25:56 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>[DRIVERS-2584] Infinite loop in generic transactional provider due to dup keys</title>
                <link>https://jira.mongodb.org/browse/DRIVERS-2584</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;p&gt;This is a follow-up to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-34059&quot; title=&quot;DuplicateKeyError aborts transaction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-34059&quot;&gt;&lt;del&gt;SERVER-34059&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This can cause an infinite loop when implementing a generic transactional callback.&lt;/p&gt;

&lt;p&gt;Say my client code does something like this in pseudo-code:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;inTransaction&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; execute insert with duplicate key&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;&#160; catch exception, return something&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;The client has caught the error and returned something rather than re-throwing. However, the `inTransaction` implementation does not know that the transaction has been aborted due to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-34059&quot; title=&quot;DuplicateKeyError aborts transaction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-34059&quot;&gt;&lt;del&gt;SERVER-34059&lt;/del&gt;&lt;/a&gt; (see also &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-11493&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/DOCS-11493&lt;/a&gt;, and so attempts to commit.&lt;/p&gt;

&lt;p&gt;The commit call now throws a `MongoCommandException` with error 251 (`NoSuchTransaction`). This exception also has the `TransientTransactionError` label. Therefore, per documentation (&lt;a href=&quot;https://www.mongodb.com/docs/manual/core/transactions-in-applications/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.mongodb.com/docs/manual/core/transactions-in-applications/&lt;/a&gt;), the `inTransaction` implementation should retry the entire transaction.&lt;/p&gt;

&lt;p&gt;The client code then attempts the same insert resulting in dup key again, and now we have an infinite loop.&lt;/p&gt;

&lt;p&gt;I understand that technical issues prevent the server from not aborting the transaction on the dup key error. However, the inTransaction implementation needs some way to differentiate this case from other transient errors, allowing it to ignore the error at commit time instead of retrying. We could ignore all NoSuchTransaction errors at commit time, but that feels like it may cause other unexpected issues.&lt;/p&gt;

&lt;p&gt;Perhaps the error could carry an additional label? Something like &quot;TransactionAbortedDueToDupKey&quot; or maybe &quot;TransactionAbortedDueToFailingOperation&quot; or something like that?&lt;/p&gt;</description>
                <environment></environment>
        <key id="2281094">DRIVERS-2584</key>
            <summary>Infinite loop in generic transactional provider due to dup keys</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="13453" iconUrl="https://jira.mongodb.org/images/icons/status_generic.gif" description="">Implementing</status>
                    <statusCategory id="4" key="indeterminate" colorName="inprogress"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="dmitry.rybakov@mongodb.com">Dmitry Rybakov</assignee>
                                    <reporter username="rocketraman@gmail.com">Raman Gupta</reporter>
                        <labels>
                            <label>alex+</label>
                            <label>james+</label>
                            <label>rachelle+</label>
                    </labels>
                <created>Fri, 3 Mar 2023 20:27:22 +0000</created>
                <updated>Tue, 12 Dec 2023 14:36:31 +0000</updated>
                                                                <component>Transactions</component>
                                        <votes>0</votes>
                                    <watches>17</watches>
                                                                                                                <comments>
                            <comment id="5925439" author="xgen-internal-githook" created="Tue, 5 Dec 2023 08:18:49 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Dmitry Rybakov&apos;, &apos;email&apos;: &apos;dmitry.rybakov@mongodb.com&apos;, &apos;username&apos;: &apos;comandeo&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-2584&quot; title=&quot;Infinite loop in generic transactional provider due to dup keys&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-2584&quot;&gt;DRIVERS-2584&lt;/a&gt; Errors handling in Convenient Transactions API (#1475)&lt;/p&gt;

&lt;p&gt;Co-authored-by: Andreas Braun &amp;lt;alcaeus@users.noreply.github.com&amp;gt;&lt;br/&gt;
Co-authored-by: Jeremy Mikola &amp;lt;jmikola@gmail.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/specifications/commit/13117d601fb6ea177e485880175b5be1651a7e46&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/commit/13117d601fb6ea177e485880175b5be1651a7e46&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5601373" author="durran.jordan@10gen.com" created="Mon, 31 Jul 2023 11:09:56 +0000"  >&lt;p&gt;Looks like the solution here is for the driver to apply some custom label in this case and then not to retry the transaction in that specific scenario.&lt;/p&gt;</comment>
                            <comment id="5337832" author="durran.jordan@10gen.com" created="Tue, 11 Apr 2023 12:43:01 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=chris.kelly%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;chris.kelly@mongodb.com&quot;&gt;chris.kelly@mongodb.com&lt;/a&gt; could the server add the proposed label to the error for any case where the driver must not retry the transaction? Maybe something like &quot;NonRetryableTransactionError&quot; or something similar? Or is the expectation here that the driver would apply the label in this specific case?&lt;/p&gt;</comment>
                            <comment id="5252527" author="JIRAUSER1265262" created="Mon, 6 Mar 2023 17:47:39 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rocketraman%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;rocketraman@gmail.com&quot;&gt;rocketraman@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for the detailed report! I&apos;ll pass this along to the relevant team to look into this further.&lt;/p&gt;

&lt;p&gt;Christopher&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2453857">NODE-5659</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10620">
                    <name>Issue split</name>
                                            <outwardlinks description="split to">
                                        <issuelink>
            <issuekey id="2486988">CDRIVER-4755</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487010">CSHARP-4828</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2486997">CXX-2778</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487022">GODRIVER-3033</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487034">NODE-5721</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487055">RUBY-3341</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487058">RUST-1788</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487040">MOTOR-1203</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487049">PHPLIB-1298</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487045">PYTHON-4019</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2487028">JAVA-5227</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5006R00001xKDgaQAG]]]></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_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;&lt;b&gt;Summary of necessary driver changes&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Document that errors should not be silently handled when using convenient transaction api&lt;/li&gt;
	&lt;li&gt;Document that command errors may abort transaction on the server&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;Commits that describes docs changes&lt;/b&gt; &lt;br/&gt;
&lt;em&gt;(and/or refer to an existing language POC if needed)&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/specifications/commit/13117d601fb6ea177e485880175b5be1651a7e46&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;specificatios@13117d6&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-ruby-driver/commit/e84afdef034234efc592b3a376dc1a5da4c457c4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;RUBY POC&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10951" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Driver Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10748"><![CDATA[Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_23952" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Driver Compliance</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<style type='text/css'>
         #scriptField, #scriptField *{
                border: 1px solid black;
            }

            #scriptField{
                border-collapse: collapse;
            }

            #scriptField td {
                text-align: center; /* Center-align text in table cells */
            }

            #scriptField td.key {
                text-align: left; /* Left-align text in the Key column */
            }

            #scriptField a {
                text-decoration: none; /* Remove underlines from links */
                border: none; /* Remove border from links */
            }
            
            /* Add green background color to cells with FixVersion */
            #scriptField td.hasFixVersion {
                background-color: #00FF00; /* Green color code */
            }

            /* Center-align the first row headers */
            #scriptField th {
                text-align: center;
            }
        </style>
<table id='scriptField'>
  <tr>
    <th>Key</th>
    <th>Status/Resolution</th>
    <th>FixVersion</th>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CDRIVER-4755'>CDRIVER-4755</a>
    </td>
    <td>Backlog</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CXX-2778'>CXX-2778</a>
    </td>
    <td>Backlog</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/CSHARP-4828'>CSHARP-4828</a>
    </td>
    <td>Backlog</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/GODRIVER-3033'>GODRIVER-3033</a>
    </td>
    <td>Backlog</td>
    <td class=''>2.1.0</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/JAVA-5227'>JAVA-5227</a>
    </td>
    <td>Backlog</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/NODE-5721'>NODE-5721</a>
    </td>
    <td>Backlog</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/MOTOR-1203'>MOTOR-1203</a>
    </td>
    <td>Backlog</td>
    <td class=''>3.4</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PYTHON-4019'>PYTHON-4019</a>
    </td>
    <td>Scheduled</td>
    <td class='hasFixVersion'>4.7</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/PHPLIB-1298'>PHPLIB-1298</a>
    </td>
    <td>Backlog</td>
    <td class=''></td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUBY-3341'>RUBY-3341</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>2.19.3</td>
  </tr>
  <tr>
    <td class='key'>
      <a href='https://jira.mongodb.org/browse/RUST-1788'>RUST-1788</a>
    </td>
    <td>Fixed</td>
    <td class='hasFixVersion'>2.8.0</td>
  </tr>
</table>]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18362" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                        <customfieldname>Engineering Lead</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>andreas.braun@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_21553" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Quarter</customfieldname>
                        <customfieldvalues>
                                        <label>FY24Q4</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1hb20:</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_14261" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>Start date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 2 Nov 2023 00:00:00 +0000</customfieldvalue>

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