<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:56:43 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-41062] Always return TransactionTooLarge rather than BSONObjectTooLarge when transaction is too large to fit in a single applyOps</title>
                <link>https://jira.mongodb.org/browse/SERVER-41062</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;We should backport the moving of the try clause in onTransactionCommit up to also cover the opsArray.done() call since it is possible for that call to throw a BSONObjectTooLarge exception, as we do in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40790&quot; title=&quot;Test downgrading 4.2 to 4.0 and then commit when transaction is too large to fit in a single applyOps&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40790&quot;&gt;&lt;del&gt;SERVER-40790&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The call in question on the 4.0 branch is here: &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ed33d2f8e66cd907ef13ee162f6a1dac3ff25672/src/mongo/db/op_observer_impl.cpp#L918&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/ed33d2f8e66cd907ef13ee162f6a1dac3ff25672/src/mongo/db/op_observer_impl.cpp#L918&lt;/a&gt;&lt;/p&gt;
</description>
                <environment></environment>
        <key id="760803">SERVER-41062</key>
            <summary>Always return TransactionTooLarge rather than BSONObjectTooLarge when transaction is too large to fit in a single applyOps</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="jason.chan@mongodb.com">Jason Chan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 May 2019 19:39:40 +0000</created>
                <updated>Sun, 29 Oct 2023 22:21:12 +0000</updated>
                            <resolved>Tue, 2 Jul 2019 18:43:45 +0000</resolved>
                                    <version>4.0.9</version>
                                    <fixVersion>4.0.11</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="2310070" author="xgen-internal-githook" created="Tue, 2 Jul 2019 18:43:18 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Siyuan Zhou&apos;, &apos;email&apos;: &apos;visualzhou@gmail.com&apos;, &apos;username&apos;: &apos;visualzhou&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-41062&quot; title=&quot;Always return TransactionTooLarge rather than BSONObjectTooLarge when transaction is too large to fit in a single applyOps&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-41062&quot;&gt;&lt;del&gt;SERVER-41062&lt;/del&gt;&lt;/a&gt; Always return TransactionTooLarge rather than BSONObjectTooLarge when transaction is too large to fit in a single applyOps&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/de8b171fbd730be5f82d0c4b6a3c378000167246&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/de8b171fbd730be5f82d0c4b6a3c378000167246&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2244835" author="siyuan.zhou@10gen.com" created="Mon, 13 May 2019 18:13:24 +0000"  >&lt;p&gt;Thanks, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=william.schultz&quot; class=&quot;user-hover&quot; rel=&quot;william.schultz&quot;&gt;william.schultz&lt;/a&gt; for the clarification. Even if getDurableReplOperationSize() overestimates the size, it&apos;ll still be a subtle assumption to rely on. To code defensively and to make the code easier to reason about, it&apos;s still better to make the change in 4.0. I think it&apos;s fine to just extend try-catch to cover more lines without a targeted test. That&apos;s easier than guaranteeing the overestimation. However as you mentioned offline, its priority is low.&lt;/p&gt;</comment>
                            <comment id="2244826" author="william.schultz" created="Mon, 13 May 2019 18:02:55 +0000"  >&lt;p&gt;To clarify, my hypothesis was that the size calculation made by &lt;tt&gt;repl::OplogEntry::getDurableReplOperationSize&lt;/tt&gt; overestimates by enough bytes so that by the time we place the operation into a BSONArray inside an applyOps object, we would have already failed inside TransactionParticipant. I think the thing to investigate would be to compare the size estimate returned by &lt;tt&gt;repl::OplogEntry::getDurableReplOperationSize&lt;/tt&gt; for a given operation with the actual size needed to place it inside an applyOps object subarray.&lt;/p&gt;</comment>
                            <comment id="2244825" author="siyuan.zhou@10gen.com" created="Mon, 13 May 2019 18:01:45 +0000"  >&lt;p&gt;According to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/07d92d96d8a7f949a578b6606103a59cb7060e49/src/mongo/db/session.cpp#L1024-L1027&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the comment&lt;/a&gt;, we don&apos;t assume&#160;&lt;tt&gt;repl::OplogEntry::getReplOperationSize()&lt;/tt&gt; gives an overestimate of the actual size, so we need to have try-catch to cover &lt;tt&gt;array.done()&lt;/tt&gt;, which is what the try-catch was supposed to cover.&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;   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;    // _transactionOperationBytes is based on the in-memory size of the operation.  With overhead,&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;    // we expect the BSON size of the operation to be larger, so it&apos;s possible to make a transaction&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;    // just a bit too large and have it fail only in the commit.  It&apos;s still useful to fail early&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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-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;    // when possible (e.g. to avoid exhausting server memory).&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;</comment>
                            <comment id="2240254" author="jason.chan" created="Thu, 9 May 2019 17:47:46 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=siyuan.zhou&quot; class=&quot;user-hover&quot; rel=&quot;siyuan.zhou&quot;&gt;siyuan.zhou&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After discussing with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=william.schultz&quot; class=&quot;user-hover&quot; rel=&quot;william.schultz&quot;&gt;william.schultz&lt;/a&gt;, this backport might not be necessary since we check the transaction size here &lt;a href=&quot;https://github.com/mongodb/mongo/blob/76912f3714ddcd82a3b53e1ecebba0044ac13d07/src/mongo/db/session.cpp#L1071&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/76912f3714ddcd82a3b53e1ecebba0044ac13d07/src/mongo/db/session.cpp#L1071&lt;/a&gt; before entering the Op Observer &lt;tt&gt;onCommit&lt;/tt&gt; call. &lt;/p&gt;

&lt;p&gt;The bug existed in 4.2 because of the specific edge case where we start a 4.2 style transaction with no size limit, and then perform a downgrade and try to commit that large transaction. At the point of commit, &lt;tt&gt;opsArray.done()&lt;/tt&gt; will end up trying to fit the large transaction into a single &lt;tt&gt;applyOps&lt;/tt&gt; and throw BSONObjectTooLarge. We don&apos;t expect this to happen in 4.0 since we would be unable to create a large transaction in the first place. We should instead be hitting the error in &lt;tt&gt;addTransactionOperation&lt;/tt&gt; before ever reaching the &lt;tt&gt;onTransactionCommit&lt;/tt&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="743944">SERVER-40790</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>5.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_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_14166" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Branch</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="15641"><![CDATA[v4.0]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 13 May 2019 17:11:27 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 32 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </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, 32 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>jason.chan@mongodb.com</customfieldvalue>
            <customfieldvalue>siyuan.zhou@mongodb.com</customfieldvalue>
            <customfieldvalue>william.schultz@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|huyb93:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hunol3:</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="3001">Repl 2019-07-01</customfieldvalue>
    <customfieldvalue id="3026">Repl 2019-07-15</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|huxxif:</customfieldvalue>

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