<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:55:42 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-62650] RecordStore RecordId initialization can deadlock transactions with cache eviction</title>
                <link>https://jira.mongodb.org/browse/SERVER-62650</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;There is a bug with our RecordId initialization that is more generally described by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61116&quot; title=&quot;Audit and add assertions against using multiple WT_SESSIONs on the same thread&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61116&quot;&gt;SERVER-61116&lt;/a&gt;. As a consequence, very large multi-document transactions that consume most of cache can deadlock. In practice, this has to be the &lt;b&gt;first&lt;/b&gt; transaction to write to a given collection.&lt;/p&gt;

&lt;p&gt;We &lt;a href=&quot;https://github.com/mongodb/mongo/blob/147566c15c9658bce3df65dd02f9661e77222da7/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp#L1823-L1824&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;create a new WT_SESSION&lt;/a&gt; to call largest_key() to lazily initialize the highest RecordId for a collection (as of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-58409&quot; title=&quot;Startup RecordId initialization is flawed with durable history and reconstructing prepared transactions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-58409&quot;&gt;&lt;del&gt;SERVER-58409&lt;/del&gt;&lt;/a&gt;). We can do this while holding hostage another session that is pinning a large amount of data in the cache. If this large transaction is pinning enough data, then the largest_key() call can block, but the session pinning that content cannot be rolled-back because it is held by the same thread.&lt;/p&gt;

&lt;p&gt;We should use an &quot;operation_timeout_ms&quot; here, as we did in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61097&quot; title=&quot;SizeStorer can cause deadlocks with cache eviction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61097&quot;&gt;&lt;del&gt;SERVER-61097&lt;/del&gt;&lt;/a&gt;. This will cause the operation to receive a WT_ROLLBACK after a period of time, which we should throw back to the parent operation to retry.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1964192">SERVER-62650</key>
            <summary>RecordStore RecordId initialization can deadlock transactions with cache eviction</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="louis.williams@mongodb.com">Louis Williams</assignee>
                                    <reporter username="louis.williams@mongodb.com">Louis Williams</reporter>
                        <labels>
                    </labels>
                <created>Fri, 14 Jan 2022 14:59:09 +0000</created>
                <updated>Sun, 29 Oct 2023 21:44:06 +0000</updated>
                            <resolved>Fri, 4 Feb 2022 17:05:33 +0000</resolved>
                                    <version>5.2.0</version>
                    <version>5.1.2</version>
                    <version>5.0.6</version>
                                    <fixVersion>5.3.0</fixVersion>
                    <fixVersion>5.2.1</fixVersion>
                    <fixVersion>5.0.7</fixVersion>
                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4429052" author="xgen-internal-githook" created="Wed, 23 Mar 2022 11:20:26 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-62650&quot; title=&quot;RecordStore RecordId initialization can deadlock transactions with cache eviction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-62650&quot;&gt;&lt;del&gt;SERVER-62650&lt;/del&gt;&lt;/a&gt; Limit cache wait time when initializing RecordIds&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 14b9051a791865503f3b101a62c0903f5c15a4a8)&lt;br/&gt;
(cherry picked from commit 041dfbb36dddce27c8ef96cecb8ec259ca8f5054)&lt;br/&gt;
Branch: v5.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e66d22908deffd85d31672456b934224b16811ee&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e66d22908deffd85d31672456b934224b16811ee&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4341386" author="xgen-internal-githook" created="Tue, 8 Feb 2022 08:40:35 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-62650&quot; title=&quot;RecordStore RecordId initialization can deadlock transactions with cache eviction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-62650&quot;&gt;&lt;del&gt;SERVER-62650&lt;/del&gt;&lt;/a&gt; Limit cache wait time when initializing RecordIds&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 14b9051a791865503f3b101a62c0903f5c15a4a8)&lt;br/&gt;
Branch: v5.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/041dfbb36dddce27c8ef96cecb8ec259ca8f5054&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/041dfbb36dddce27c8ef96cecb8ec259ca8f5054&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4336439" author="xgen-internal-githook" created="Fri, 4 Feb 2022 16:58:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-62650&quot; title=&quot;RecordStore RecordId initialization can deadlock transactions with cache eviction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-62650&quot;&gt;&lt;del&gt;SERVER-62650&lt;/del&gt;&lt;/a&gt; Limit cache wait time when initializing RecordIds&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/14b9051a791865503f3b101a62c0903f5c15a4a8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/14b9051a791865503f3b101a62c0903f5c15a4a8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4329860" author="xgen-internal-githook" created="Wed, 2 Feb 2022 11:41:42 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-62650&quot; title=&quot;RecordStore RecordId initialization can deadlock transactions with cache eviction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-62650&quot;&gt;&lt;del&gt;SERVER-62650&lt;/del&gt;&lt;/a&gt; Limit cache wait time when initializing RecordIds&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 6d509615d2d6ef7af38e1b982b6272a54e9b591c.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c45f8885f8c2aa87a8498add9228969600600de0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c45f8885f8c2aa87a8498add9228969600600de0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4327102" author="xgen-internal-githook" created="Tue, 1 Feb 2022 11:47:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-62650&quot; title=&quot;RecordStore RecordId initialization can deadlock transactions with cache eviction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-62650&quot;&gt;&lt;del&gt;SERVER-62650&lt;/del&gt;&lt;/a&gt; Limit cache wait time when initializing RecordIds&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/6d509615d2d6ef7af38e1b982b6272a54e9b591c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/6d509615d2d6ef7af38e1b982b6272a54e9b591c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4309159" author="louis.williams" created="Mon, 24 Jan 2022 14:09:16 +0000"  >&lt;p&gt;Actually, the more I think about it, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60839&quot; title=&quot;Introduce a TemporarilyUnavailable error type&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60839&quot;&gt;&lt;del&gt;SERVER-60839&lt;/del&gt;&lt;/a&gt; won&apos;t help. The test will still occasionally fail in this passthrough suite that fuzzes the WT eviction settings. So I think the work in this ticket will be to allow this passthrough to fail with a WriteConflict when this does happen. I&apos;m going to leave a TODO for&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60839&quot; title=&quot;Introduce a TemporarilyUnavailable error type&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60839&quot;&gt;&lt;del&gt;SERVER-60839&lt;/del&gt;&lt;/a&gt; to replace the usage of WriteConflict with the new error code.&lt;/p&gt;</comment>
                            <comment id="4309063" author="louis.williams" created="Mon, 24 Jan 2022 13:13:47 +0000"  >&lt;p&gt;Since this is a problem in a single-transaction environment with a small dirty cache, if we choose to throw a WriteConflictException in this scenario, the results are going to look very similar to&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60839&quot; title=&quot;Introduce a TemporarilyUnavailable error type&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60839&quot;&gt;&lt;del&gt;SERVER-60839&lt;/del&gt;&lt;/a&gt;. If the caller doesn&apos;t handle the WCE, the test will fail, and if they do handle the error, they will just retry forever.&lt;/p&gt;

&lt;p&gt;Instead of a write conflict, we should return the same error that we return in&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60839&quot; title=&quot;Introduce a TemporarilyUnavailable error type&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60839&quot;&gt;&lt;del&gt;SERVER-60839&lt;/del&gt;&lt;/a&gt;. I&apos;m marking this ticket as dependent on that.&lt;/p&gt;

&lt;p&gt;One note: it&apos;s not clear that we can safely backport&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60839&quot; title=&quot;Introduce a TemporarilyUnavailable error type&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60839&quot;&gt;&lt;del&gt;SERVER-60839&lt;/del&gt;&lt;/a&gt; to 5.0 (or even 4.4) without potentially breaking application behavior, but if we can&apos;t, we&apos;ll have to revisit how to fix this in older branches.&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="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                                <inwardlinks description="is caused by">
                                        <issuelink>
            <issuekey id="1814107">SERVER-58409</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1903239">SERVER-60839</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1913356">SERVER-61116</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.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="22676"><![CDATA[v5.2]]></customfieldvalue>
    <customfieldvalue key="21777"><![CDATA[v5.0]]></customfieldvalue>
    <customfieldvalue key="18953"><![CDATA[v4.4]]></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>Mon, 24 Jan 2022 14:26:17 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 46 weeks 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>
                            1 year, 46 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>155.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>louis.williams@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0gwo7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i000vj:</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="5552">Execution Team 2022-02-07</customfieldvalue>
    <customfieldvalue id="5588">Execution Team 2022-02-21</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|i0gitj:</customfieldvalue>

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