<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:14:22 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-47508] opCtx-&gt;inMultiDocumentTransaction() is set to true for test case run &quot;outside&quot; of a transaction</title>
                <link>https://jira.mongodb.org/browse/SERVER-47508</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In this &lt;a href=&quot;https://github.com/mongodb/mongo/blob/dd910a6ed371aaa41a04611ab3b0cf79ac1fce7b/jstests/core/txns/multi_statement_transaction_command_args.js#L236-L243&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;test case&lt;/a&gt;, we attempt to run a command &#8220;outside&#8221; of a transaction. This test case currently &lt;a href=&quot;https://github.com/mongodb/mongo/blob/dd910a6ed371aaa41a04611ab3b0cf79ac1fce7b/src/mongo/db/initialize_operation_session_info.cpp#L133&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;reaches&lt;/a&gt; the branch where we set &lt;tt&gt;inMultiDocumentTransaction&lt;/tt&gt; to true on the &lt;tt&gt;OperationContext&lt;/tt&gt;, since it&apos;s a case where we specify &lt;tt&gt;txnNumber&lt;/tt&gt; and &lt;tt&gt;autocommit=false&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Eventually, the test case will fail this &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d3dcf079e3276e8e4ac512c4e2ffbbab7df78138/src/mongo/db/transaction_participant.cpp#L429-L434&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;validation&lt;/a&gt;, but until then, &lt;tt&gt;opCtx-&amp;gt;inMultiDocumentTransaction&lt;/tt&gt; is true. &lt;/p&gt;

&lt;p&gt;It seems to be a bug that &lt;tt&gt;opCtx-&amp;gt;inMultiDocumentTransaction&lt;/tt&gt; is true even though the test case should eventually fail with &lt;tt&gt;NoSuchTransaction&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1313215">SERVER-47508</key>
            <summary>opCtx-&gt;inMultiDocumentTransaction() is set to true for test case run &quot;outside&quot; of a transaction</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="13202">Works as Designed</resolution>
                                        <assignee username="backlog-server-repl">Backlog - Replication Team</assignee>
                                    <reporter username="maria.vankeulen@mongodb.com">Maria van Keulen</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Apr 2020 17:05:55 +0000</created>
                <updated>Fri, 27 Oct 2023 13:52:52 +0000</updated>
                            <resolved>Mon, 27 Apr 2020 17:18:09 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="3057045" author="siyuan.zhou@10gen.com" created="Mon, 27 Apr 2020 17:34:31 +0000"  >&lt;p&gt;The semantics of opCtx-&amp;gt;inMultiDocumentTransaction() works by design as explained above.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/mongodb/mongo/commit/d1094411f42197b450c466edcdfa2972947df53f#diff-c9d556577233c2a8a54ee3f57ff56bc3R248&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;transaction test case&lt;/a&gt; allows more error codes that could only occur in passthrough test cases that specify read concerns. We could avoid attaching read concerns in those cases, but the risk of relaxing the error codes seems minimal to me.&lt;/p&gt;</comment>
                            <comment id="3039448" author="siyuan.zhou@10gen.com" created="Tue, 14 Apr 2020 19:05:40 +0000"  >&lt;p&gt;Since we moved the code to check whether a read concern is given without &lt;tt&gt;startTransaction&lt;/tt&gt;&#160;in transactions earlier in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47444&quot; title=&quot;Assertion to guard against individual commands inside transactions specifying their own readConcern happens after waiting for readConcern&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47444&quot;&gt;&lt;del&gt;SERVER-47444&lt;/del&gt;&lt;/a&gt;, it returns an InvalidOption error earlier before the expected NoSuchTransaction error in the linked test case.&#160;&lt;a href=&quot;https://evergreen.mongodb.com/task/mongodb_mongo_master_enterprise_rhel_62_64_bit_causally_consistent_jscore_txns_passthrough_patch_e8770f7f496352b77ff506982a52a4d1800cc7c1_5e9474b2c9ec4430a7d992ab_20_04_13_14_18_35##%257B%2522compare%2522%253A%255B%257B%2522hash%2522%253A%2522e8770f7f496352b77ff506982a52a4d1800cc7c1%2522%257D%255D%257D&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;causally_consistent_jscore_txns_passthrough&lt;/a&gt; encounters this error.&lt;/p&gt;

&lt;p&gt;I don&apos;t think the server behavior is a problem since when a command violates two checks, returning an error for either one seems fine to me. If we want to make the test more consistent, we could change the passthrough tests not to attach read concerns on transaction statements without &lt;tt&gt;startTransaction&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;opCtx-&amp;gt;inMultiDocumentTransaction() is designed to represent whether the users requested a transaction. The command could fail with NoSuchTransaction error later. However, after parsing, validation and transaction unstash,&#160;opCtx-&amp;gt;inMultiDocumentTransaction() guarantees the transaction is open for command execution.&lt;/p&gt;

&lt;p&gt;Thus, I&apos;d propose to focus on fixing the passthrough test in this ticket if we think it&apos;s necessary.&lt;/p&gt;</comment>
                            <comment id="3037184" author="maria.vankeulen" created="Mon, 13 Apr 2020 17:09:26 +0000"  >&lt;p&gt;This issue came up during &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47444&quot; title=&quot;Assertion to guard against individual commands inside transactions specifying their own readConcern happens after waiting for readConcern&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47444&quot;&gt;&lt;del&gt;SERVER-47444&lt;/del&gt;&lt;/a&gt;, which moves this &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d0b52ddd66d7e9d79ff5d46a35d760a328464da7/src/mongo/db/service_entry_point_common.cpp#L597-L599&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;assertion&lt;/a&gt; prior to the aforementioned &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d3dcf079e3276e8e4ac512c4e2ffbbab7df78138/src/mongo/db/transaction_participant.cpp#L429-L434&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;validation&lt;/a&gt;. As a result, the linked &lt;a href=&quot;https://github.com/mongodb/mongo/blob/dd910a6ed371aaa41a04611ab3b0cf79ac1fce7b/jstests/core/txns/multi_statement_transaction_command_args.js#L243&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;test case&lt;/a&gt; fails with &lt;tt&gt;InvalidOptions&lt;/tt&gt; instead of &lt;tt&gt;NoSuchTransaction&lt;/tt&gt; in suites that add a readConcern to this invocation, since the new readConcern check relies on the value of &lt;tt&gt;opCtx-&amp;gt;inMultiDocumentTransaction()&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;I chatted with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=samy.lanka&quot; class=&quot;user-hover&quot; rel=&quot;samy.lanka&quot;&gt;samy.lanka&lt;/a&gt; about this, and for now we believe it makes sense to allow the test case to accommodate both errors, and modify the wording of the test case.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1501866">SERVER-51352</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1310085">SERVER-47444</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>3.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>Tue, 14 Apr 2020 19:05:40 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 41 weeks, 2 days ago
                        </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>backlog-server-repl</customfieldvalue>
            <customfieldvalue>maria.vankeulen@mongodb.com</customfieldvalue>
            <customfieldvalue>siyuan.zhou@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxezev:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hx2hxz:</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_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|hxelo7:</customfieldvalue>

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