<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:46:04 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-59005] Storage engine clean shutdown can race with startup</title>
                <link>https://jira.mongodb.org/browse/SERVER-59005</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In certain circumstances, storage engine startup can race with clean shutdown, and lead to the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/223b7eee505f30f597f91e77260de5711e4919e7/src/mongo/db/storage/storage_engine_impl.cpp#L1223-L1224&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;following invariant failure&lt;/a&gt;:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;Invariant failure !listenerNotRegistered&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/mongodb/mongo/blob/223b7eee505f30f597f91e77260de5711e4919e7/src/mongo/db/mongod_main.cpp#L1375&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;shutdown task&lt;/a&gt; that is called from the signal handler to cleanly shut down the storage engine holds a Global X lock. But the initAndListen thread, which &lt;a href=&quot;https://github.com/mongodb/mongo/blob/223b7eee505f30f597f91e77260de5711e4919e7/src/mongo/db/mongod_main.cpp#L408&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;initializes the storage engine&lt;/a&gt;, and which &lt;a href=&quot;https://github.com/mongodb/mongo/blob/223b7eee505f30f597f91e77260de5711e4919e7/src/mongo/db/storage/storage_engine_impl.cpp#L737&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;registers the TimestampMonitor listener&lt;/a&gt;, does not hold this lock.&lt;/p&gt;

&lt;p&gt;The shutdown path assumes that the storage engine has been completely initialized, but that is not the case. So the server can crash if it is shut down cleanly before the storage engine finishes starting up.&lt;/p&gt;

&lt;p&gt;I&apos;m surprised we don&apos;t already hold the Global X lock during storage engine initialization, but perhaps we should. An alternative to taking a global lock would be to keep shutdown expeditious and permit this type of race by relaxing the existing invariant. &lt;/p&gt;</description>
                <environment></environment>
        <key id="1838553">SERVER-59005</key>
            <summary>Storage engine clean shutdown can race with startup</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="benety.goh@mongodb.com">Benety Goh</assignee>
                                    <reporter username="louis.williams@mongodb.com">Louis Williams</reporter>
                        <labels>
                    </labels>
                <created>Mon, 2 Aug 2021 15:47:26 +0000</created>
                <updated>Sun, 29 Oct 2023 21:50:05 +0000</updated>
                            <resolved>Fri, 27 Aug 2021 14:33:07 +0000</resolved>
                                                    <fixVersion>5.1.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="4106722" author="JIRAUSER1259052" created="Wed, 6 Oct 2021 18:07:01 +0000"  >&lt;p&gt;Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it&#8217;s been triggered. For more active release information, please keep an eye on #server-release. Thank you!&lt;/p&gt;</comment>
                            <comment id="4026076" author="xgen-internal-githook" created="Fri, 27 Aug 2021 11:24:51 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benety Goh&apos;, &apos;email&apos;: &apos;benety@mongodb.com&apos;, &apos;username&apos;: &apos;benety&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-59005&quot; title=&quot;Storage engine clean shutdown can race with startup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-59005&quot;&gt;&lt;del&gt;SERVER-59005&lt;/del&gt;&lt;/a&gt; rename TimestampMonitor::addListener() to be test-only&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e502f2d3965ac4147d303e956a582b7c4eef8232&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e502f2d3965ac4147d303e956a582b7c4eef8232&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4026040" author="xgen-internal-githook" created="Fri, 27 Aug 2021 10:56:24 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benety Goh&apos;, &apos;email&apos;: &apos;benety@mongodb.com&apos;, &apos;username&apos;: &apos;benety&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-59005&quot; title=&quot;Storage engine clean shutdown can race with startup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-59005&quot;&gt;&lt;del&gt;SERVER-59005&lt;/del&gt;&lt;/a&gt; replace TimestampMonitor::removeListener() with clearListeners&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/775f3f943d2c6ee13c67c495a24fffa958e98df3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/775f3f943d2c6ee13c67c495a24fffa958e98df3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4025771" author="xgen-internal-githook" created="Fri, 27 Aug 2021 06:13:06 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benety Goh&apos;, &apos;email&apos;: &apos;benety@mongodb.com&apos;, &apos;username&apos;: &apos;benety&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-59005&quot; title=&quot;Storage engine clean shutdown can race with startup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-59005&quot;&gt;&lt;del&gt;SERVER-59005&lt;/del&gt;&lt;/a&gt; TimestampMonitor accepts initial listener on construction&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/efafb725229d0388549b7f7c0389dfa50f2142e5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/efafb725229d0388549b7f7c0389dfa50f2142e5&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4025433" author="xgen-internal-githook" created="Thu, 26 Aug 2021 22:31:43 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Benety Goh&apos;, &apos;email&apos;: &apos;benety@mongodb.com&apos;, &apos;username&apos;: &apos;benety&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-59005&quot; title=&quot;Storage engine clean shutdown can race with startup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-59005&quot;&gt;&lt;del&gt;SERVER-59005&lt;/del&gt;&lt;/a&gt; TimestampMonitor starts periodic job on construction&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/845ddb7e68889dfe32c5adec421a714dd14060f4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/845ddb7e68889dfe32c5adec421a714dd14060f4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4020421" author="benety.goh" created="Tue, 24 Aug 2021 21:10:59 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-52562&quot; title=&quot;Turn on Lock-Free reads for standalone mode&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-52562&quot;&gt;&lt;del&gt;SERVER-52562&lt;/del&gt;&lt;/a&gt; is not directly related but is interesting for the standalone scenario.&lt;/p&gt;</comment>
                            <comment id="4020387" author="benety.goh" created="Tue, 24 Aug 2021 20:57:05 +0000"  >&lt;p&gt;Each server instance registers a single TimestampListener to observe changes in &lt;a href=&quot;https://github.com/mongodb/mongo/commit/cf47aee946c42c246a9176e1df1cd27b12dde685#diff-460ca5d7f4213ba80032f604ba14fa303192143e39ab0164728d24b4193d2281R91&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;TimestampMonitor::TimestampType::kMinOfCheckpointAndOldest&lt;/a&gt;. We register the listener at process startup and remove it at shutdown.&lt;/p&gt;

&lt;p&gt;This was a new TimestampType constant introduced in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39962&quot; title=&quot;Update linux baton to minimize allocations around run&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39962&quot;&gt;&lt;del&gt;SERVER-39962&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="4020330" author="benety.goh" created="Tue, 24 Aug 2021 20:31:56 +0000"  >&lt;p&gt;The &lt;a href=&quot;https://github.com/mongodb/mongo/commit/3504c48bd882975aed1ab933ed307fc755091487#diff-460ca5d7f4213ba80032f604ba14fa303192143e39ab0164728d24b4193d2281R825&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;StorageEngineImpl::removeListener() invariant&lt;/a&gt; was added in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38128&quot; title=&quot;Create a periodic task associated with the KV engine to notify listeners of stable/oldest/checkpointed timestamp changes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38128&quot;&gt;&lt;del&gt;SERVER-38128&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>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="633710">SERVER-38128</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="670594">SERVER-38962</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1531483">SERVER-52562</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>8.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>Tue, 24 Aug 2021 20:31:56 +0000</customfieldvalue>

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


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

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 18 weeks 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_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>louis.williams@mongodb.com</customfieldvalue>
            <customfieldvalue>vivian.ge@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzvlzz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzfton:</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="5118">Execution Team 2021-09-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|hzv893:</customfieldvalue>

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