<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:51:31 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-61097] SizeStorer can cause deadlocks with cache eviction</title>
                <link>https://jira.mongodb.org/browse/SERVER-61097</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; This ticket does not fully fix the deadlock described. A complete fix was introduced in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60334&quot; title=&quot;Avoid caching the cursor and session in WiredTigerSizeStorer&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60334&quot;&gt;&lt;del&gt;SERVER-60334&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is a follow-up to &lt;a href=&quot;https://jira.mongodb.org/browse/WT-8245&quot; title=&quot;Fix eviction hang during importCollection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;WT-8245&quot;&gt;&lt;del&gt;WT-8245&lt;/del&gt;&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;There&apos;s a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/cd6a70b2343a9ba10ba36b6ba66518f60d26bf81/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp#L103&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mutex&lt;/a&gt; inside the SizeStorer that serializes access to a global WT session and cursor that we keep open forever. We let multiple threads share it, which is where the mutex comes in. In general, it&apos;s not a good idea to hold an exclusive lock and call into the storage engine.&lt;/p&gt;

&lt;p&gt;The larger problem is that the SizeStorer uses a WT_SESISON that is not the one owned by the calling operation, which may also have its own WT_SESSION.&lt;/p&gt;

&lt;p&gt;In practice, this has only shown up in importCollection. After the operation has performed a catalog write, it gets stuck inside of SizeStorer::load, holds this mutex, and blocks on cache eviction. WiredTiger will roll back transactions that have written data, but it will not roll back read-only transactions. WiredTiger cannot roll-back the SizeStorer::load() because the SizeStorer uses an entirely separate WT_SESSION than the one that importCollection uses. So even though importCollection has written data, it cannot be rolled back even if it is causing cache issues.&lt;/p&gt;

&lt;p&gt;Using more than one WT_SESSION per thread is a bug that we&apos;ve seen before.&lt;/p&gt;

&lt;p&gt;We should just get rid of this global session + cursor and require that callers pass their own OperationContext. If that&apos;s not possible for some reason, we&apos;ll need to use &quot;cache_max_wait_ms&quot; to allow the operation to time itself out. &lt;/p&gt;</description>
                <environment></environment>
        <key id="1912755">SERVER-61097</key>
            <summary>SizeStorer can cause deadlocks 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="gregory.wlodarek@mongodb.com">Gregory Wlodarek</assignee>
                                    <reporter username="louis.williams@mongodb.com">Louis Williams</reporter>
                        <labels>
                    </labels>
                <created>Thu, 28 Oct 2021 23:12:03 +0000</created>
                <updated>Sun, 29 Oct 2023 21:46:44 +0000</updated>
                            <resolved>Tue, 16 Nov 2021 15:35:33 +0000</resolved>
                                    <version>4.2.0</version>
                    <version>4.4.0</version>
                                    <fixVersion>5.2.0</fixVersion>
                    <fixVersion>5.0.6</fixVersion>
                    <fixVersion>4.4.15</fixVersion>
                    <fixVersion>4.2.21</fixVersion>
                                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="4640976" author="louis.williams" created="Mon, 27 Jun 2022 08:04:30 +0000"  >&lt;p&gt;Note that these commits did not fix the problem in the description regarding the SizeStorer load() function. Instead, a change was made to a different function, flush, that did not address the problem. &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-67514&quot; title=&quot;SizeStorer load() can get stuck in page eviction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-67514&quot;&gt;&lt;del&gt;SERVER-67514&lt;/del&gt;&lt;/a&gt; was opened to fix the original bug in load().&lt;/p&gt;</comment>
                            <comment id="4560201" author="xgen-internal-githook" created="Thu, 19 May 2022 17:40:53 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Gregory Wlodarek&apos;, &apos;email&apos;: &apos;gregory.wlodarek@mongodb.com&apos;, &apos;username&apos;: &apos;GWlodarek&apos;}
&lt;p&gt;Message: &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; SizeStorer flush uses &apos;operation_timeout_ms&apos; to avoid deadlocks with cache eviction&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 57e351357ea73450df84b905674b127508aeb064)&lt;br/&gt;
(cherry picked from commit 7c65da785398047cb6569170bc614c99abf4ca07)&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/88ea6629a5980694ff4f4e83781fb4ae310671c1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/88ea6629a5980694ff4f4e83781fb4ae310671c1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4559827" author="xgen-internal-githook" created="Thu, 19 May 2022 16:11:41 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Gregory Wlodarek&apos;, &apos;email&apos;: &apos;gregory.wlodarek@mongodb.com&apos;, &apos;username&apos;: &apos;GWlodarek&apos;}
&lt;p&gt;Message: &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; SizeStorer flush uses &apos;operation_timeout_ms&apos; to avoid deadlocks with cache eviction&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 57e351357ea73450df84b905674b127508aeb064)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e961f38055121370927ec172007cbd829ccc3014&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e961f38055121370927ec172007cbd829ccc3014&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4250590" author="xgen-internal-githook" created="Wed, 15 Dec 2021 16:49:30 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Gregory Wlodarek&apos;, &apos;email&apos;: &apos;gregory.wlodarek@mongodb.com&apos;, &apos;username&apos;: &apos;GWlodarek&apos;}
&lt;p&gt;Message: &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; SizeStorer flush uses &apos;operation_timeout_ms&apos; to avoid deadlocks with cache eviction&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 57e351357ea73450df84b905674b127508aeb064)&lt;br/&gt;
Branch: v5.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/144f3b1bab6434d4610c8671d89623a612d42465&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/144f3b1bab6434d4610c8671d89623a612d42465&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4191954" author="xgen-internal-githook" created="Tue, 16 Nov 2021 15:21:28 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Gregory Wlodarek&apos;, &apos;email&apos;: &apos;gregory.wlodarek@mongodb.com&apos;, &apos;username&apos;: &apos;GWlodarek&apos;}
&lt;p&gt;Message: &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; SizeStorer flush uses &apos;operation_timeout_ms&apos; to avoid deadlocks with cache eviction&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/57e351357ea73450df84b905674b127508aeb064&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/57e351357ea73450df84b905674b127508aeb064&lt;/a&gt;&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="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1901469">WT-8245</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1913356">SERVER-61116</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1886752">SERVER-60334</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2076179">SERVER-67514</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_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="21777"><![CDATA[v5.0]]></customfieldvalue>
    <customfieldvalue key="18953"><![CDATA[v4.4]]></customfieldvalue>
    <customfieldvalue key="16775"><![CDATA[v4.2]]></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>Fri, 12 Nov 2021 15:48:15 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 32 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_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, 32 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>19.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>gregory.wlodarek@mongodb.com</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|i086t3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr2mlb:</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="5421">Execution Team 2021-11-15</customfieldvalue>
    <customfieldvalue id="5422">Execution Team 2021-11-29</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|i07syf:</customfieldvalue>

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