<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:01:52 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-65106] Don&apos;t perform eviction after prepared transaction commits or rolls-back</title>
                <link>https://jira.mongodb.org/browse/SERVER-65106</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;This is an alternative solution to both &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-64613&quot; title=&quot;Periodically wake up when waiting for prepare conflicts&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-64613&quot;&gt;&lt;del&gt;SERVER-64613&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/WT-8975&quot; title=&quot;Eviction is triggered with prepared transactions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;WT-8975&quot;&gt;&lt;del&gt;WT-8975&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When MongoDB encounters a prepare conflict in WiredTiger, &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c5837542821a86feeea41e6a00c96ef746f03b15/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp#L366-L372&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;we wait until an active MongoDB WriteUnitOfWork commits or aborts&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There is a deadlock caused by this approach that can be described as follows:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;A prepared transaction has updated a document.&lt;/li&gt;
	&lt;li&gt;A concurrent operation tries to read that document, but it hits a prepare conflict. It waits until the prepared transactions commits or aborts (via a notification). While it waits, its cursor remains positioned, preventing the page from being evicted.&lt;/li&gt;
	&lt;li&gt;The prepared transaction aborts or commits, but after the transition rolls-back, it is recruited for bonus eviction. It cannot evict anything because the page is pinned by the reader. So even though the transaction has been successfully rolled back in the storage engine, cannot make progress to signal the reader to continue. The reader is waiting for a notification, which would unpin the page.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;em&gt;This is only a bug in a system with one prepared transaction, since any transactions committing or aborting would wake the reader.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We want to break this deadlock in MongoDB by requesting to WiredTiger that the operation not perform eviction after it rolls back or commits.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2012930">SERVER-65106</key>
            <summary>Don&apos;t perform eviction after prepared transaction commits or rolls-back</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>Thu, 31 Mar 2022 07:53:12 +0000</created>
                <updated>Sun, 29 Oct 2023 21:40:17 +0000</updated>
                            <resolved>Mon, 27 Feb 2023 09:09:02 +0000</resolved>
                                                    <fixVersion>7.0.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>11</watches>
                                                                                                                <comments>
                            <comment id="5232293" author="louis.williams" created="Mon, 27 Feb 2023 09:09:02 +0000"  >&lt;p&gt;This implements the solution proposed in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-64613&quot; title=&quot;Periodically wake up when waiting for prepare conflicts&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-64613&quot;&gt;&lt;del&gt;SERVER-64613&lt;/del&gt;&lt;/a&gt; to periodically wake up blocked operations.&lt;/p&gt;

&lt;p&gt;Even though this problem exists on older branches, I am choosing not to request backports because this problem has only ever been reproduced in abnormal WT cache configurations.&lt;/p&gt;</comment>
                            <comment id="5229248" author="xgen-internal-githook" created="Fri, 24 Feb 2023 16:41: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-65106&quot; title=&quot;Don&amp;#39;t perform eviction after prepared transaction commits or rolls-back&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-65106&quot;&gt;&lt;del&gt;SERVER-65106&lt;/del&gt;&lt;/a&gt; Periodically wake to check if prepared transaction has ended&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/d5f4a148778c761dbee720106786c8290fec428b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/d5f4a148778c761dbee720106786c8290fec428b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5193634" author="connie.chen" created="Mon, 13 Feb 2023 16:28:48 +0000"  >&lt;p&gt;We think the simplest solution is to periodically wake up and see if a transaction has been committed&lt;/p&gt;</comment>
                            <comment id="4479490" author="louis.williams" created="Wed, 13 Apr 2022 09:57:31 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=keith.smith%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;keith.smith@mongodb.com&quot;&gt;keith.smith@mongodb.com&lt;/a&gt;, yes, the reader has an active transaction. While I think the answer is &quot;yes&quot;, we could reset the cursor while waiting, it would require some significant changes to our code. We instrument waiting for prepare conflicts in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/5966f1395bca6147ef0322b7cda7e84121f4bf98/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp#L2272&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;almost every cursor API call we make to WiredTiger&lt;/a&gt;. We would probably need to expand the scope of each retry loop to include the part that positions the cursor. And I imagine we would have to carefully consider each loop to ensure each sequence is safely retryable.&lt;/p&gt;</comment>
                            <comment id="4478493" author="keith.smith" created="Tue, 12 Apr 2022 21:05:24 +0000"  >&lt;p&gt;Step two of the scenario on the description says:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;A concurrent operation tries to read that document, but it hits a prepare conflict. It waits until the prepared transactions commits or aborts (via a notification). While it waits, its cursor remains positioned, preventing the page from being evicted.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Just to clarify, does the reader here have an active transaction while it is waiting? &#160;If so, is there other transaction state that may be in play here (i.e., updates from previous operations)? If the read cursor is really the only WT resource the reader has, could it just reset the cursor before sleeping? &#160;&lt;/p&gt;</comment>
                            <comment id="4446867" author="chenhao.qu" created="Thu, 31 Mar 2022 09:53:21 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=louis.williams&quot; class=&quot;user-hover&quot; rel=&quot;louis.williams&quot;&gt;louis.williams&lt;/a&gt; I don&apos;t think there is a way to do that at the moment. But I think we can add a configuration in transaction commit to achieve that.&lt;/p&gt;</comment>
                            <comment id="4446675" author="louis.williams" created="Thu, 31 Mar 2022 07:56:01 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=chenhao.qu&quot; class=&quot;user-hover&quot; rel=&quot;chenhao.qu&quot;&gt;chenhao.qu&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=agorrod&quot; class=&quot;user-hover&quot; rel=&quot;agorrod&quot;&gt;agorrod&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=etienne.petrel&quot; class=&quot;user-hover&quot; rel=&quot;etienne.petrel&quot;&gt;etienne.petrel&lt;/a&gt;: Is there any way to ask WiredTiger that a transaction not perform eviction when it &lt;em&gt;commits&lt;/em&gt;? We currently use &quot;operation_timeout_ms&quot; in certain cases of rollback, but I don&#8217;t believe this works for &lt;tt&gt;commit_transaction&lt;/tt&gt;. I ask because &lt;a href=&quot;https://jira.mongodb.org/browse/WT-8975&quot; title=&quot;Eviction is triggered with prepared transactions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;WT-8975&quot;&gt;&lt;del&gt;WT-8975&lt;/del&gt;&lt;/a&gt; was closed, but we don&#8217;t have a way to achieve the same behavior in MongoDB. We are not thrilled with &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-64613&quot; title=&quot;Periodically wake up when waiting for prepare conflicts&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-64613&quot;&gt;&lt;del&gt;SERVER-64613&lt;/del&gt;&lt;/a&gt; as a solution (periodically waking up) because we believe it masks potential bugs and is a workaround rather than a long-term solution.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="2013204">WT-9040</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2003908">SERVER-64613</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2005268">WT-8975</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2197543">SERVER-71674</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>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25136"><![CDATA[Storage Execution]]></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>Thu, 31 Mar 2022 09:53:21 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        49 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/WT-9040'>WT-9040</a></s>]]></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>
                            49 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>10.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>chenhao.qu@mongodb.com</customfieldvalue>
            <customfieldvalue>connie.chen@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>keith.smith@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|i0p75r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i157cz:i</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_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="6773">Execution Team 2023-03-06</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|i0otb3:</customfieldvalue>

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