<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:52:46 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-39672] ReadConcern level in multi-statement transactions defaults to &quot;snapshot&quot;</title>
                <link>https://jira.mongodb.org/browse/SERVER-39672</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;If a user starts a transaction with no readConcern level (the default), the transaction reads from the all-committed snapshot instead of at the last applied timestamp. The expected behavior is if there is no readConcern level it behaves the same as an explicit readConcern level &quot;local&quot; and reads from the last applied timestamp.&lt;/p&gt;

&lt;p&gt;Transactions with an explicit readConcern level &quot;local&quot; behave correctly, the bug affects the default common case, with no explicit level.&lt;/p&gt;

&lt;p&gt;Details: In _extractReadConcern in service_entry_point common, if we&apos;re starting a multi-statement transaction, we save the user&apos;s readConcern level as ReadConcernArgs::_originalLevel, and replace ReadConcernArgs::_level with kSnapshot. Later, we determine whether to read from a snapshot by calling ReadConcernArgs::getOriginalLevel(). &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=judah.schvimer&quot; class=&quot;user-hover&quot; rel=&quot;judah.schvimer&quot;&gt;judah.schvimer&lt;/a&gt; says the intention of this is to make readConcern::getLevel() return kSnapshot in all multi-statement transactions. He says &quot;We upconvert all readconcerns to snapshot for ease of coding, but we use the original read concern level &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a6eab704282bd9c68249325d4fc38a9b2253724a/src/mongo/db/transaction_participant.cpp#L835-L838&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;when calling _setSpeculativeTransactionOpTime&lt;/a&gt;&quot;. (I, Jesse, don&apos;t know how this eases coding yet.)&lt;/p&gt;

&lt;p&gt;However, getOriginalLevel() doesn&apos;t fulfill this intention. If the client provides no readConcern, then ReadConcernArgs::_originalLevel is boost::none. Then getOriginalLevel() does:&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;    return _originalLevel.value_or(getLevel());&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;... which is the upconverted level, &quot;snapshot&quot;!&lt;/p&gt;</description>
                <environment></environment>
        <key id="700844">SERVER-39672</key>
            <summary>ReadConcern level in multi-statement transactions defaults to &quot;snapshot&quot;</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="lingzhi.deng@mongodb.com">Lingzhi Deng</assignee>
                                    <reporter username="jesse@mongodb.com">A. Jesse Jiryu Davis</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 Feb 2019 20:58:13 +0000</created>
                <updated>Sun, 29 Oct 2023 22:23:52 +0000</updated>
                            <resolved>Thu, 28 Mar 2019 19:32:39 +0000</resolved>
                                                    <fixVersion>4.1.10</fixVersion>
                    <fixVersion>4.0.10</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>16</watches>
                                                                                                                <comments>
                            <comment id="2329308" author="jesse" created="Tue, 16 Jul 2019 18:44:16 +0000"  >&lt;p&gt;Thank you!&lt;/p&gt;</comment>
                            <comment id="2329156" author="wei" created="Tue, 16 Jul 2019 17:33:23 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jesse&quot; class=&quot;user-hover&quot; rel=&quot;jesse&quot;&gt;jesse&lt;/a&gt;&#160;I have filed&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42250&quot; title=&quot;`readConcern: snapshot` cause many write conflicts&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42250&quot;&gt;&lt;del&gt;SERVER-42250&lt;/del&gt;&lt;/a&gt; for the situation. Thanks for checking this.&lt;/p&gt;</comment>
                            <comment id="2324454" author="jesse" created="Sat, 13 Jul 2019 21:58:11 +0000"  >&lt;p&gt;Thanks for your comment, Wei Li. Could you please open a new Jira ticket with some more details about the jobs you&apos;re running and when you see write conflicts, how your replica set is configured, what version you&apos;re running, perhaps some sample code that reproduces the issue? Then we can give you a precise answer.&lt;/p&gt;</comment>
                            <comment id="2318405" author="wei" created="Wed, 10 Jul 2019 05:06:05 +0000"  >&lt;p&gt;Before we get the update to the formal docs, can we have some explanation why this can cause write conflict issues.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;we have jobs running in &lt;tt&gt;readConcern: snapshot&lt;/tt&gt; seeing many write conflicts, but &lt;tt&gt;readConcern: local&lt;/tt&gt; simply passes&lt;/li&gt;
	&lt;li&gt;our job does not have any real write conflicts so that seeing many write conflicts is strange to us&lt;/li&gt;
	&lt;li&gt;this is running only one primary in replset mode without any secondaries: unsure whether it changed behavior&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;As this write conflict is not the normal write skew from snapshot consistency system, what is causing this?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;/p&gt;</comment>
                            <comment id="2318169" author="jesse" created="Wed, 10 Jul 2019 02:12:01 +0000"  >&lt;p&gt;Agreed, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=bartle&quot; class=&quot;user-hover&quot; rel=&quot;bartle&quot;&gt;bartle&lt;/a&gt;, we&apos;ll update the docs there.&lt;/p&gt;</comment>
                            <comment id="2318097" author="bartle" created="Wed, 10 Jul 2019 00:32:04 +0000"  >&lt;p&gt;It might be worth calling this change out on &lt;a href=&quot;https://docs.mongodb.com/manual/reference/read-concern/#read-concern-levels?&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/reference/read-concern/#read-concern-levels?&lt;/a&gt;  We ran into this ourselves and were pretty confused by what was going on.&lt;/p&gt;</comment>
                            <comment id="2209093" author="luke.chen" created="Thu, 11 Apr 2019 02:08:48 +0000"  >&lt;p&gt;Fixing up fixversion as this ticket was not included as part of 4.0.9 release.&lt;/p&gt;</comment>
                            <comment id="2203308" author="xgen-internal-githook" created="Fri, 5 Apr 2019 14:22:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Lingzhi Deng&apos;, &apos;username&apos;: &apos;ldennis&apos;, &apos;email&apos;: &apos;lingzhi.deng@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39672&quot; title=&quot;ReadConcern level in multi-statement transactions defaults to &amp;quot;snapshot&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39672&quot;&gt;&lt;del&gt;SERVER-39672&lt;/del&gt;&lt;/a&gt;: default to local if no read concern specified for a multi-statment transaction&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 74fd169e8867b4633d4c1677055dda74e3460238)&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1ab343a48799b42074e0056e9f486ed0c444956d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1ab343a48799b42074e0056e9f486ed0c444956d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2195132" author="lingzhi.deng" created="Thu, 28 Mar 2019 19:32:39 +0000"  >&lt;p&gt;I think this is a minor behavior change because now startTransaction() defaults to &quot;local&quot; read concern if no read concern is provided. Due to the bug described in this ticket, startTransaction() used to run with read concern &quot;snapshot&quot; by default.&lt;/p&gt;</comment>
                            <comment id="2194033" author="xgen-internal-githook" created="Thu, 28 Mar 2019 03:35:10 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;max.hirschhorn@mongodb.com&apos;, &apos;name&apos;: &apos;Max Hirschhorn&apos;, &apos;username&apos;: &apos;visemet&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39672&quot; title=&quot;ReadConcern level in multi-statement transactions defaults to &amp;quot;snapshot&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39672&quot;&gt;&lt;del&gt;SERVER-39672&lt;/del&gt;&lt;/a&gt; Fix lint.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/cf14abb8e454edc042d5f4ad1768f19321135a79&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/cf14abb8e454edc042d5f4ad1768f19321135a79&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2193852" author="xgen-internal-githook" created="Wed, 27 Mar 2019 22:08:38 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;lingzhi.deng@mongodb.com&apos;, &apos;name&apos;: &apos;Lingzhi Deng&apos;, &apos;username&apos;: &apos;ldennis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39672&quot; title=&quot;ReadConcern level in multi-statement transactions defaults to &amp;quot;snapshot&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39672&quot;&gt;&lt;del&gt;SERVER-39672&lt;/del&gt;&lt;/a&gt;: default to local if no read concern specified for a multi-statment transaction&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/74fd169e8867b4633d4c1677055dda74e3460238&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/74fd169e8867b4633d4c1677055dda74e3460238&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2156529" author="jesse" created="Wed, 20 Feb 2019 00:21:07 +0000"  >&lt;p&gt;We clearly had made the same mistake in mongos (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39274&quot; title=&quot;Mongos should not upconvert transaction read concern level to snapshot if none is provided&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39274&quot;&gt;&lt;del&gt;SERVER-39274&lt;/del&gt;&lt;/a&gt;), investigate the relationship b/w that bug and this one, and in what version these bugs were introduced.&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">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                        <issuelink>
            <issuekey id="848212">DOCS-12871</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="679832">SERVER-39274</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>12.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.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="10011"><![CDATA[Minor Change]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 25 Mar 2019 17:41:38 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 30 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_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>A transaction started with no explicit readConcern used to default to readConcern level &amp;quot;snapshot&amp;quot;, now it defaults to &amp;quot;local&amp;quot;.</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</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, 30 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>63.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>jesse@mongodb.com</customfieldvalue>
            <customfieldvalue>bartle</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>lingzhi.deng@mongodb.com</customfieldvalue>
            <customfieldvalue>luke.chen@mongodb.com</customfieldvalue>
            <customfieldvalue>wei</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|huo30v:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hudu0f:</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="2823">Repl 2019-03-25</customfieldvalue>
    <customfieldvalue id="2896">Repl 2019-04-08</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_17051" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Teams Impacted</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16944"><![CDATA[Docs]]></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|hunpa7:</customfieldvalue>

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