<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:02:39 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-43242] Deadlock involving commands acquiring global X lock and prepared transactions waiting for write concern</title>
                <link>https://jira.mongodb.org/browse/SERVER-43242</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;DropDatabase or any commands that acquire the global lock in X mode can be blocked by prepared transactions. The enqueued global X lock can block oplog queries which need  the global IS lock. If these oplog queries and the data replication are needed by the prepared transaction&apos;s write concern, then the prepare transaction cannot make progress. Thus a deadlock occurs.&lt;/p&gt;

&lt;p&gt;In reality, the coordinator may time out and decide to abort the transaction, but this could be an issue for testing.&lt;/p&gt;</description>
                <environment></environment>
        <key id="920953">SERVER-43242</key>
            <summary>Deadlock involving commands acquiring global X lock and prepared transactions waiting for write concern</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="13203">Gone away</resolution>
                                        <assignee username="evin.roesle@mongodb.com">Evin Roesle</assignee>
                                    <reporter username="siyuan.zhou@mongodb.com">Siyuan Zhou</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Sep 2019 22:48:33 +0000</created>
                <updated>Fri, 27 Oct 2023 20:42:41 +0000</updated>
                            <resolved>Thu, 16 Jan 2020 16:30:27 +0000</resolved>
                                                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>17</watches>
                                                                                                                <comments>
                            <comment id="2735177" author="evin.roesle" created="Thu, 16 Jan 2020 16:30:27 +0000"  >&lt;p&gt;Gone Away in 4.4 featureCompatibilityVersion&lt;/p&gt;</comment>
                            <comment id="2658830" author="siyuan.zhou@10gen.com" created="Fri, 20 Dec 2019 21:48:19 +0000"  >&lt;p&gt;Reopening the ticket since mapreduce can still cause the deaklock.&lt;/p&gt;</comment>
                            <comment id="2483690" author="james.wahlin@10gen.com" created="Tue, 15 Oct 2019 20:13:36 +0000"  >&lt;blockquote&gt;&lt;p&gt;We have a project in 4.4 to deprecate mapReduce&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;To be clear on the mapReduce time frame, we are currently working on replacing the command internals with an implementation that uses the aggregation framework. Once we are done with our project (during the 4.3 dev cycle) we will delete the legacy mongos implementation. The legacy mongod implementation, which is the part that can take a global X locks, will remain in place until we branch 4.4 and will be used by mixed-version clusters during 4.2-&amp;gt;4.4 upgrade. It will be deleted early in the 4.5 dev cycle.&lt;/p&gt;</comment>
                            <comment id="2467120" author="lingzhi.deng" created="Fri, 4 Oct 2019 18:46:09 +0000"  >&lt;p&gt;Is the work of this ticket just to work around the issue in tests? Making oplog special is probably less error-prone in the long run?&lt;/p&gt;</comment>
                            <comment id="2421740" author="esha.maharishi@10gen.com" created="Mon, 16 Sep 2019 17:18:18 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=judah.schvimer&quot; class=&quot;user-hover&quot; rel=&quot;judah.schvimer&quot;&gt;judah.schvimer&lt;/a&gt;, hm, we could have it use a fixed short timeout that matches what is used elsewhere in sharding, like 30 or 60 seconds. I don&apos;t have all the context about this deadlock, so it was just a suggestion that would prevent tests from hanging forever.&lt;/p&gt;</comment>
                            <comment id="2415147" author="judah.schvimer" created="Tue, 10 Sep 2019 19:32:01 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=esha.maharishi&quot; class=&quot;user-hover&quot; rel=&quot;esha.maharishi&quot;&gt;esha.maharishi&lt;/a&gt;, what maxTimeMS would you include? If it&apos;s the transaction timeout, then that&apos;s set to (essentially) infinite in our tests.&lt;/p&gt;</comment>
                            <comment id="2415026" author="esha.maharishi@10gen.com" created="Tue, 10 Sep 2019 18:28:19 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=judah.schvimer&quot; class=&quot;user-hover&quot; rel=&quot;judah.schvimer&quot;&gt;judah.schvimer&lt;/a&gt;, &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;, how about we make the coordinator send maxTimeMS in all prepareTransaction requests?&lt;/p&gt;</comment>
                            <comment id="2414828" author="judah.schvimer" created="Tue, 10 Sep 2019 16:54:49 +0000"  >&lt;p&gt;I&apos;m not sure how to work around this in our tests besides blacklisting important test coverage, relaxing the expectations that transactions commit (and reducing the timeout), or implicitly adding a maxTimeMS to all commands that acquire a Global X Lock.&lt;/p&gt;</comment>
                            <comment id="2414746" author="siyuan.zhou@10gen.com" created="Tue, 10 Sep 2019 16:10:19 +0000"  >&lt;p&gt;Confirmed with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=esha.maharishi&quot; class=&quot;user-hover&quot; rel=&quot;esha.maharishi&quot;&gt;esha.maharishi&lt;/a&gt; that the coordinator will time out on the prepareTransaction command after 1 minute by default and write an abort decision. The coordinator will then send the abortTransaction command to all nodes. Since waiting for write concern doesn&apos;t hold the session checked out and RSTL lock isn&apos;t involved. The abortTransaction should go through successfully and resolve the issue. If we don&apos;t fix this deadlock, I&apos;d hope we can have tests for this automatic resolution.&lt;/p&gt;</comment>
                            <comment id="2414438" author="milkie" created="Tue, 10 Sep 2019 14:07:28 +0000"  >&lt;p&gt;I actually think it would be fine to work around these in our tests.  We have a project in 4.4 to deprecate mapReduce, usage of the cloner is almost gone, applyOps is internal, and reIndex can be fixed to not take a global lock.&lt;/p&gt;</comment>
                            <comment id="2414409" author="judah.schvimer" created="Tue, 10 Sep 2019 13:56:01 +0000"  >&lt;p&gt;&lt;tt&gt;reIndex&lt;/tt&gt;, &lt;tt&gt;resizeOplog&lt;/tt&gt;, &lt;tt&gt;mapReduce&lt;/tt&gt;, the &quot;Cloner&quot; (so anything that is used for), and &lt;tt&gt;applyOps&lt;/tt&gt; all take a Global X Lock. I don&apos;t think we can fix all of these (especially not mapReduce). &lt;/p&gt;

&lt;p&gt;The urgency is definitely lower since it won&apos;t be a permanent deadlock and none of these commands are very common. That said, I don&apos;t think it&apos;s something we want to just work around in our tests. I would be pro oplog queries being more special. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt;, what do you think of that approach?&lt;/p&gt;</comment>
                            <comment id="2414334" author="milkie" created="Tue, 10 Sep 2019 13:22:53 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33272&quot; title=&quot;The DatabaseHolder::close() function no longer requires a global write lock and neither does the dropDatabase command.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33272&quot;&gt;&lt;del&gt;SERVER-33272&lt;/del&gt;&lt;/a&gt; will change dropDatabase to only acquire a DB lock.  We can backport that to 4.2.  There are still other commands that take a global lock, I believe.&lt;/p&gt;</comment>
                            <comment id="2413708" author="siyuan.zhou@10gen.com" created="Mon, 9 Sep 2019 22:55:56 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=geert.bosch&quot; class=&quot;user-hover&quot; rel=&quot;geert.bosch&quot;&gt;geert.bosch&lt;/a&gt;, did we remove the requirement of global X lock for dropDatabases? Do we still have other cases that can take a global lock in master and 4.2? We could remove all global X lock by external commands or make oplog queries even more special by requiring no lock or its own lock.&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">
                                        <issuelink>
            <issuekey id="966276">SERVER-43927</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10620">
                    <name>Issue split</name>
                                            <outwardlinks description="split to">
                                        <issuelink>
            <issuekey id="970588">SERVER-44026</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="970593">SERVER-44027</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="970597">SERVER-44028</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="970601">SERVER-44029</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="970605">SERVER-44030</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="970636">SERVER-44033</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="970707">SERVER-44037</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="496684">SERVER-33272</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1100101">SERVER-45612</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>13.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="16775"><![CDATA[v4.2]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 10 Sep 2019 13:22:53 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 3 weeks, 6 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_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, 3 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21.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>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
            <customfieldvalue>evin.roesle@mongodb.com</customfieldvalue>
            <customfieldvalue>james.wahlin@mongodb.com</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>lingzhi.deng@mongodb.com</customfieldvalue>
            <customfieldvalue>siyuan.zhou@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hvp7nr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6ya7:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="3261">Repl 2019-10-21</customfieldvalue>
    <customfieldvalue id="3303">Repl 2019-11-04</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|hvotx3:</customfieldvalue>

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