<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:25:40 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-2471] Run abortTransaction when commitTransaction in withTransaction times out</title>
                <link>https://jira.mongodb.org/browse/DRIVERS-2471</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #fafbfc;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #fafbfc;&quot;&gt;
&lt;h3&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;In&#160;the &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/transactions-convenient-api/transactions-convenient-api.rst#sequence-of-actions&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;sequence of actions&lt;/a&gt; section of the convenient transactions API (see&#160;step 9), we never run &lt;tt&gt;abortTransaction&lt;/tt&gt; when &lt;tt&gt;commitTransaction&lt;/tt&gt; fails. This may be because a failed commit may unpin the session and the abort may run on a different mongos in sharded clusters. If &lt;tt&gt;commitTransaction&lt;/tt&gt; times out (either due to default &lt;tt&gt;withTransaction&lt;/tt&gt; timeout or a CSOT timeout), the transaction will not be committed and will not be aborted. This means no new transaction can be started on the session and other transactions on other sessions may encounter write conflicts. Should we reconsider running &lt;tt&gt;abortTransaction&lt;/tt&gt; if &lt;tt&gt;commitTransaction&lt;/tt&gt; fails with a non-retryable error in &lt;tt&gt;withTransaction&lt;/tt&gt;?&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Motivation&quot;&gt;&lt;/a&gt;&lt;b&gt;Motivation&lt;/b&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;a name=&quot;Whoistheaffectedenduser%3F&quot;&gt;&lt;/a&gt;Who is the affected end user?&lt;/h4&gt;
&lt;p&gt;Users of the convenient transactions API (particularly when using timeouts).&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;Howdoesthisaffecttheenduser%3F&quot;&gt;&lt;/a&gt;How does this affect the end user?&lt;/h4&gt;
&lt;p&gt;Potential write conflicts and unexpected session errors.&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;Howlikelyisitthatthisproblemorusecasewilloccur%3F&quot;&gt;&lt;/a&gt;How likely is it that this problem or use case will occur?&lt;/h4&gt;
&lt;p&gt;A little unlikely. For the case of timeouts, the timeout would have to occur &lt;em&gt;after&lt;/em&gt; the callback&apos;s operations but &lt;em&gt;before&lt;/em&gt; commitTransaction finishes.&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;Iftheproblemdoesoccur%2Cwhataretheconsequencesandhowseverearethey%3F&quot;&gt;&lt;/a&gt;If the problem does occur, what are the consequences and how severe are they?&lt;/h4&gt;
&lt;p&gt;Potential write conflicts and unexpected session errors.&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;Isthisissueurgent%3F&quot;&gt;&lt;/a&gt;Is this issue urgent?&lt;/h4&gt;
&lt;p&gt;No.&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;Isthisticketrequiredbyadownstreamteam%3F&quot;&gt;&lt;/a&gt;Is this ticket required by a downstream team?&lt;/h4&gt;
&lt;p&gt;mongosync brought up this issue in the Go driver (see related issue).&lt;/p&gt;

&lt;h4&gt;&lt;a name=&quot;Isthisticketonlyfortests%3F&quot;&gt;&lt;/a&gt;Is this ticket only for tests?&lt;/h4&gt;
&lt;p&gt;No.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="2158765">DRIVERS-2471</key>
            <summary>Run abortTransaction when commitTransaction in withTransaction times out</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="-1">Unassigned</assignee>
                                    <reporter username="benji.rewis@mongodb.com">Benji Rewis</reporter>
                        <labels>
                    </labels>
                <created>Thu, 13 Oct 2022 18:57:41 +0000</created>
                <updated>Fri, 16 Dec 2022 19:18:53 +0000</updated>
                                                                <component>Transactions</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="4928502" author="benji.rewis" created="Wed, 26 Oct 2022 14:20:19 +0000"  >&lt;p&gt;I realize this is a pretty niche case, but we are fixing this in the Go driver (see related Go driver ticket). I&apos;m wondering if we could just add one step between 7 and 8 in the sequence of actions with something like:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;8. If withTransaction has timed out (either due to the default 120-second timeout or a client-side operations level timeout), invoke abortTransaction on the session and return the timeout error.&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Once &lt;tt&gt;commitTransaction&lt;/tt&gt; is invoked in the current step 8, a client-side timeout does not definitively mean the transaction was &lt;em&gt;not&lt;/em&gt; committed server-side, so I think after that point, our only choice is to potentially retry &lt;tt&gt;commitTransaction&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="4902440" author="benji.rewis" created="Thu, 13 Oct 2022 22:26:19 +0000"  >&lt;blockquote&gt;
&lt;p&gt;This part is not true, IIRC starting a new transaction on the same session will automatically abort the previous transaction (if it&apos;s still open).&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Oh interesting, do drivers automatically abort the previous in-progress transaction? Or is that logic on the server? Calling &lt;tt&gt;startTransaction&lt;/tt&gt; twice in a row on the same session in the Go driver does return a client-side error &lt;tt&gt;ErrTransactInProgress&lt;/tt&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Could you describe the exact scenario in a little more detail? Is it that commitTransaction is called and then fails with a client side timeout error before sending the commit command to the server?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Yep, that&apos;s the scenario.&lt;/p&gt;</comment>
                            <comment id="4902120" author="shane.harvey" created="Thu, 13 Oct 2022 20:13:14 +0000"  >&lt;blockquote&gt;&lt;p&gt;This means no new transaction can be started on the session&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This part is not true, IIRC starting a new transaction on the same session will automatically abort the previous transaction (if it&apos;s still open).&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Should we reconsider running abortTransaction if commitTransaction fails with a non-retryable error in withTransaction?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I believe we could only run abortTransaction if the commitTransaction was never even attempted (otherwise the session will raise this error: &quot;Cannot call abortTransaction after calling commitTransaction&quot;). If commitTransaction was attempted and failed then we can only retry by calling commitTransaction again.&lt;/p&gt;

&lt;p&gt;Could you describe the exact scenario in a little more detail? Is it that commitTransaction is called and then fails with a client side timeout error before sending the commit command to the server?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2149065">GODRIVER-2565</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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_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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0wohk:</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>