<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:45:15 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-37179] Wait for specified write concern whenever commitTransaction returns a NoSuchTransaction error</title>
                <link>https://jira.mongodb.org/browse/SERVER-37179</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If a transaction commits locally against a primary, but that primary goes down without replicating the commit, then if the commitTransaction command is retried against the new primary it will error with NoSuchTransaction.  Generally a NoSuchTransaction error in this case indicates that the transaction either aborted or rolled back, and thus it would be safe to retry the entire transaction over.  If, however, the writeConcern times out in this case then its possible that the original primary could be re-elected without rolling back the txn commit, and thus the transaction could wind up surviving after all.&lt;/p&gt;</description>
                <environment></environment>
        <key id="606224">SERVER-37179</key>
            <summary>Wait for specified write concern whenever commitTransaction returns a NoSuchTransaction error</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="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="siyuan.zhou@mongodb.com">Siyuan Zhou</assignee>
                                    <reporter username="spencer@mongodb.com">Spencer Brody</reporter>
                        <labels>
                    </labels>
                <created>Mon, 17 Sep 2018 23:06:03 +0000</created>
                <updated>Sun, 29 Oct 2023 22:28:07 +0000</updated>
                            <resolved>Tue, 13 Nov 2018 23:44:02 +0000</resolved>
                                                    <fixVersion>4.0.7</fixVersion>
                    <fixVersion>4.1.6</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="2171623" author="xgen-internal-githook" created="Tue, 5 Mar 2019 20:01:49 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Siyuan Zhou&apos;, &apos;username&apos;: &apos;visualzhou&apos;, &apos;email&apos;: &apos;siyuan.zhou@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37179&quot; title=&quot;Wait for specified write concern whenever commitTransaction returns a NoSuchTransaction error&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37179&quot;&gt;&lt;del&gt;SERVER-37179&lt;/del&gt;&lt;/a&gt; Wait for specified write concern whenever commitTransaction returns a NoSuchTransaction error&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 6394bfafd5c42bfeb01b6686498d7fff697d9480)&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/38896cab6a0aad9bca1f9e9f5de65ea0cdc62d22&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/38896cab6a0aad9bca1f9e9f5de65ea0cdc62d22&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2170163" author="xgen-internal-githook" created="Mon, 4 Mar 2019 22:07:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Siyuan Zhou&apos;, &apos;username&apos;: &apos;visualzhou&apos;, &apos;email&apos;: &apos;siyuan.zhou@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37179&quot; title=&quot;Wait for specified write concern whenever commitTransaction returns a NoSuchTransaction error&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37179&quot;&gt;&lt;del&gt;SERVER-37179&lt;/del&gt;&lt;/a&gt; Pull out starting transaction from session checkout and push it down to before command execution.&lt;/p&gt;

&lt;p&gt;This patch redid 248601a647 and 4fb38d9c10 from master on v4.0 branch.&lt;/p&gt;

&lt;p&gt;Transaction will begin or continue after waiting for read concern. If&lt;br/&gt;
an error is thrown on starting transaction, it&apos;ll be able to wait for&lt;br/&gt;
write concern if a write concern is specified.&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5366d3c6ea014f1bd19eee1a149f46f3b1227a2b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5366d3c6ea014f1bd19eee1a149f46f3b1227a2b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2060935" author="xgen-internal-githook" created="Tue, 13 Nov 2018 23:43:36 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Siyuan Zhou&apos;, &apos;email&apos;: &apos;siyuan.zhou@mongodb.com&apos;, &apos;username&apos;: &apos;visualzhou&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37179&quot; title=&quot;Wait for specified write concern whenever commitTransaction returns a NoSuchTransaction error&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37179&quot;&gt;&lt;del&gt;SERVER-37179&lt;/del&gt;&lt;/a&gt; Wait for specified write concern whenever commitTransaction returns a NoSuchTransaction error&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/6394bfafd5c42bfeb01b6686498d7fff697d9480&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/6394bfafd5c42bfeb01b6686498d7fff697d9480&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2056703" author="xgen-internal-githook" created="Thu, 8 Nov 2018 23:16:29 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Siyuan Zhou&apos;, &apos;email&apos;: &apos;siyuan.zhou@mongodb.com&apos;, &apos;username&apos;: &apos;visualzhou&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37179&quot; title=&quot;Wait for specified write concern whenever commitTransaction returns a NoSuchTransaction error&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37179&quot;&gt;&lt;del&gt;SERVER-37179&lt;/del&gt;&lt;/a&gt; Pull out starting transaction from session checkout and push it down to before command execution.&lt;/p&gt;

&lt;p&gt;Transaction will begin or continue after waiting for read concern. If&lt;br/&gt;
an error is thrown on starting transaction, it&apos;ll be able to wait for&lt;br/&gt;
write concern if a write concern is specified.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/4fb38d9c10123321dada6fe1be477f9cb99732a7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/4fb38d9c10123321dada6fe1be477f9cb99732a7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2041367" author="xgen-internal-githook" created="Thu, 25 Oct 2018 00:21:02 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Siyuan Zhou&apos;, &apos;email&apos;: &apos;siyuan.zhou@mongodb.com&apos;, &apos;username&apos;: &apos;visualzhou&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37179&quot; title=&quot;Wait for specified write concern whenever commitTransaction returns a NoSuchTransaction error&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37179&quot;&gt;&lt;del&gt;SERVER-37179&lt;/del&gt;&lt;/a&gt; Pass the reference of OperationSessionInfoFromClient around.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/248601a6473fc7364e5d790a357acbace2a42f7a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/248601a6473fc7364e5d790a357acbace2a42f7a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2029402" author="siyuan.zhou@10gen.com" created="Wed, 10 Oct 2018 19:32:15 +0000"  >&lt;p&gt;According to the design of &quot;Single Replica Set Transactions&quot;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The &#8216;commitTransaction&#8217; and &#8216;abortTransaction&#8217; commands are the only commands of a multi-statement transaction that allow a writeConcern argument. If a writeConcern argument is given on any other command of a transaction, the server will return an error, without affecting the database or the transaction state. The writeConcern argument of the &#8216;commitTransaction&#8217; and &#8216;abortTransaction&#8217; commands will have semantics analogous to existing replica set commands.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Also from the &lt;a href=&quot;https://docs.mongodb.com/manual/core/transactions/#write-concern&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;documentation&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;You can set the write concern for the transaction commit at the transaction start.&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;If unspecified at the transaction start, transactions use the session-level write concern for the commit or, if that is unset, the client-level write concern.&lt;br/&gt;
 Write concern w: 0 is not supported for transactions.&lt;/li&gt;
	&lt;li&gt;If you commit using w: 1 write concern, your transaction can be rolled back if there is a failover.&lt;/li&gt;
	&lt;li&gt;If the transaction commits with write concern &#8220;majority&#8221; and has specified read concern &quot;snapshot&quot; read concern, transaction operations are guaranteed to have read from a snapshot of majority-committed data. Otherwise, the &quot;snapshot&quot; read concern provides no guarantees that read operations used a snapshot of majority-committed data.&lt;/li&gt;
	&lt;li&gt;If the transaction commits with write concern &#8220;majority&#8221; and has specified read concern &quot;majority&quot; read concern, transaction operations are guaranteed to have read majority-committed data. Otherwise, the &quot;majority&quot; read concern provides no guarantees that read operations read majority-committed data.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;There are two problems in this ticket: 1) we don&apos;t wait for write concern if NoSuchTransaction is returned. 2) we shouldn&apos;t attach transient transaction error label if the given write concern fails. I remove the mention of &quot;majority&quot; in the title.&lt;/p&gt;</comment>
                            <comment id="2029034" author="judah.schvimer" created="Wed, 10 Oct 2018 14:54:54 +0000"  >&lt;p&gt;What is the expected behavior if the writeconcern is &lt;em&gt;not&lt;/em&gt; majority?&lt;/p&gt;</comment>
                            <comment id="2028545" author="janna.golden" created="Tue, 9 Oct 2018 23:34:21 +0000"  >&lt;p&gt;I&apos;m seeing the following scenario in testing against failover:&lt;br/&gt;
1. Node 0 is primary and running txnNum: 0 including a command with {insert : {_id: 0}}&lt;br/&gt;
2. Node 0 encounters a network error during commitTransaction with writeConcern: majority&lt;br/&gt;
3. Node 1 steps up and retries the commitTransaction&lt;br/&gt;
4. Node 1 gets NoSuchTransaction and aborts txnNum: 0&lt;br/&gt;
5. Node 1 retries the entire transaction with txnNum: 1 including a command with {insert : {_id: 0}}&lt;br/&gt;
6. Node 1 encounters a network error during commitTransaction with wc: majority&lt;br/&gt;
7. Node 0 steps back up and retries the commitTransaction&lt;br/&gt;
8. Node 0 gets NoSuchTransaction and aborts txnNum: 1&lt;br/&gt;
9. Node 0 retries the entire transaction with txnNum: 2 including a command with {insert : {_id: 0}}&lt;br/&gt;
10. Node 0 gets a duplicate key error&lt;/p&gt;</comment>
                            <comment id="2010871" author="spencer" created="Fri, 21 Sep 2018 19:31:31 +0000"  >&lt;p&gt;Really the only time commitTransaction should attach a TransientTransactionError is specifically the case where it fails with NoSuchTransaction AND the writeConcern:majority wait is successful.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="576734">SERVER-36311</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="615740">SERVER-37516</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10020">
                    <name>Gantt Dependency</name>
                                            <outwardlinks description="has to be done before">
                                        <issuelink>
            <issuekey id="532705">SERVER-34620</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                        <issuelink>
            <issuekey id="627837">SERVER-37876</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="615740">SERVER-37516</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="621900">SERVER-37681</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="606227">SERVER-37181</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="15640"><![CDATA[v4.0]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 9 Oct 2018 23:34:21 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 49 weeks, 1 day 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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 49 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>11.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>janna.golden@mongodb.com</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>siyuan.zhou@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|hu88vr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htyp27:</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="2542">Repl 2018-10-22</customfieldvalue>
    <customfieldvalue id="2543">Repl 2018-11-05</customfieldvalue>
    <customfieldvalue id="2605">Repl 2018-11-19</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|hu7v53:</customfieldvalue>

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