<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:39:53 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-79026] Failing to cancel the JournalFlusher thread might lead to 3-way deadlock</title>
                <link>https://jira.mongodb.org/browse/SERVER-79026</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-73539&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;SERVER-73539&lt;/a&gt; introduced replay protection for &lt;tt&gt;setAllowmigrations&lt;/tt&gt;, as part of those changes (and the posterior fix &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-78021&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;SERVER-78021&lt;/a&gt;), we create an &lt;tt&gt;AlternativeClientRegion&lt;/tt&gt; where a transaction with a majority write concern is performed. Currently the &lt;tt&gt;JournalFlusher&lt;/tt&gt; is &lt;a href=&quot;https://github.com/10gen/mongo/blob/7d595221a5ab27dec3065e8c6b63dfefa1d7aa63/src/mongo/db/storage/control/journal_flusher.cpp#L100-L103&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;an unkillable&lt;/a&gt; thread that tries to get the RSTL lock when &lt;a href=&quot;https://github.com/10gen/mongo/blob/7d595221a5ab27dec3065e8c6b63dfefa1d7aa63/src/mongo/db/storage/control/journal_flusher.cpp#L144&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;waiting until all commits before the call are durable in the journal&lt;/a&gt;, so, in the presence of a stepdown, the following scenario might happen in the config server:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;A thread with &lt;tt&gt;setAllowMigrations&lt;/tt&gt; (which checked out a session) waits for the changes to the metadata to be majority committed&lt;/li&gt;
	&lt;li&gt;A stepdown thread takes the RSTL lock and tries to checkout the session of 1. to kill it&lt;/li&gt;
	&lt;li&gt;Another thread with the &lt;tt&gt;JournalFlusher&lt;/tt&gt; tries to take the RSTL lock taken by 2.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;After 3 we have one thread (1) waiting for majority, but the thread that waits for the changes to become durable (2) is waiting for the RSTL lock that is taken by the stepdown thread (3) waiting for a session to be checked in, causing a 3-way deadlock. Attached to the ticket we can find 2 stacktraces with the problem described above.&lt;/p&gt;

&lt;p&gt;One way this could be solved is by making the &lt;tt&gt;JournalFlusher&lt;/tt&gt; thread to also be killable like the main operation (in this case the &lt;tt&gt;setAllowMigrations&lt;/tt&gt; thread).&lt;/p&gt;</description>
                <environment></environment>
        <key id="2393791">SERVER-79026</key>
            <summary>Failing to cancel the JournalFlusher thread might lead to 3-way deadlock</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="marcos.grillo@mongodb.com">Marcos Jos&#233; Grillo Ramirez</reporter>
                        <labels>
                    </labels>
                <created>Mon, 17 Jul 2023 18:00:20 +0000</created>
                <updated>Sun, 29 Oct 2023 21:18:50 +0000</updated>
                            <resolved>Tue, 18 Jul 2023 19:33:01 +0000</resolved>
                                    <version>7.1.0-rc0</version>
                                    <fixVersion>7.1.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="5575097" author="xgen-internal-githook" created="Tue, 18 Jul 2023 19:27:27 +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-79026&quot; title=&quot;Failing to cancel the JournalFlusher thread might lead to 3-way deadlock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-79026&quot;&gt;&lt;del&gt;SERVER-79026&lt;/del&gt;&lt;/a&gt; Make the JournalFlusher killable&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/7dcc87d19f79526ced914a07688b7afe9ec545f8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/7dcc87d19f79526ced914a07688b7afe9ec545f8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5574758" author="benety.goh" created="Tue, 18 Jul 2023 17:37:11 +0000"  >&lt;p&gt;We added a JS test for the killOp behavior in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-55745&quot; title=&quot;The Fuzzer can run killOp on the JournalFlusher thread and cause it to throw an unexpected error&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-55745&quot;&gt;&lt;del&gt;SERVER-55745&lt;/del&gt;&lt;/a&gt;. The expected log message logging an stepdown-interrupted Journal Flusher thread will have the same message ID as the killOp behavior.&lt;/p&gt;</comment>
                            <comment id="5574696" author="benety.goh" created="Tue, 18 Jul 2023 17:21:16 +0000"  >&lt;p&gt;We added the &lt;a href=&quot;https://github.com/mongodb/mongo/commit/606e34054ef33e59b78715263b125ff7ebea1394#diff-3f5673e687b243ebdde51648390f7e49897a539b3c9a156e21cc09f5a337efc5R83&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;stepdown exclusion&lt;/a&gt; in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-70127&quot; title=&quot;Default system operations to be killable by stepdown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-70127&quot;&gt;&lt;del&gt;SERVER-70127&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <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="2411341">SERVER-79810</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2397625">SERVER-79174</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1669722">SERVER-55745</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2250580">SERVER-73539</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2366458">SERVER-78021</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2282563">SERVER-74657</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2148681">SERVER-70127</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="462882" name="gdb.BFG-2016684.c_n1.txt" size="1440253" author="marcos.grillo@mongodb.com" created="Mon, 17 Jul 2023 17:58:31 +0000"/>
                            <attachment id="462881" name="gdb_s0_n2.txt" size="1233532" author="marcos.grillo@mongodb.com" created="Mon, 17 Jul 2023 17:58:34 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.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_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, 17 Jul 2023 18:30:19 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        29 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            29 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>140.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>benety.goh@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>gregory.wlodarek@mongodb.com</customfieldvalue>
            <customfieldvalue>marcos.grillo@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2i91r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i20e2o:</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="7181">Execution NAMR Team 2023-07-24</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|i2hv73:</customfieldvalue>

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