<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:08:12 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-25071] Ensure replication batch finishes before shutdown</title>
                <link>https://jira.mongodb.org/browse/SERVER-25071</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Much like &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-24933&quot; title=&quot;Clean shutdown of secondaries should occur in between oplog batches, not during&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-24933&quot;&gt;&lt;del&gt;SERVER-24933&lt;/del&gt;&lt;/a&gt;, we should ensure that our shutdown lands between apply batches.&lt;/p&gt;

&lt;p&gt;There are a few ways to get there:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Ignore shutdown interruptions during apply batch (not good for long running applies like index builds)&lt;/li&gt;
	&lt;li&gt;Have shutdown wait for the current apply batch (similar to above)&lt;/li&gt;
	&lt;li&gt;Undo/reset current batch work on shutdown to be in a consistent state&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;In addition we should move setting the minvalid boundaries under the PBWM lock so that minvalid reflects the completed apply batch.&lt;/p&gt;</description>
                <environment></environment>
        <key id="301199">SERVER-25071</key>
            <summary>Ensure replication batch finishes before shutdown</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="9">Done</resolution>
                                        <assignee username="mathias@mongodb.com">Mathias Stearn</assignee>
                                    <reporter username="scotthernandez">Scott Hernandez</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Jul 2016 19:26:02 +0000</created>
                <updated>Fri, 26 Jan 2018 21:37:26 +0000</updated>
                            <resolved>Fri, 26 Aug 2016 22:44:10 +0000</resolved>
                                    <version>3.3.0</version>
                                    <fixVersion>3.3.12</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="1379818" author="xgen-internal-githook" created="Thu, 8 Sep 2016 18:14:21 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;RedBeard0531&apos;, u&apos;name&apos;: u&apos;Mathias Stearn&apos;, u&apos;email&apos;: u&apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-25071&quot; title=&quot;Ensure replication batch finishes before shutdown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-25071&quot;&gt;&lt;del&gt;SERVER-25071&lt;/del&gt;&lt;/a&gt; Remove temporary invariants&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ae122d196abc39a05bb26230cd7901faecb3859d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ae122d196abc39a05bb26230cd7901faecb3859d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1369707" author="redbeard0531" created="Fri, 26 Aug 2016 22:44:10 +0000"  >&lt;p&gt;It may be worth mentioning that this may cause clean shutdowns to take longer as they will no longer interrupt operations on secondaries. This is mostly an issue with index builds.&lt;/p&gt;</comment>
                            <comment id="1369698" author="xgen-internal-githook" created="Fri, 26 Aug 2016 22:37:55 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;RedBeard0531&apos;, u&apos;name&apos;: u&apos;Mathias Stearn&apos;, u&apos;email&apos;: u&apos;mathias@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-25071&quot; title=&quot;Ensure replication batch finishes before shutdown&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-25071&quot;&gt;&lt;del&gt;SERVER-25071&lt;/del&gt;&lt;/a&gt; Flush data replication queue as part of clean shutdown&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/15c19250190932511229ac0e70bacb4c9b107b82&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/15c19250190932511229ac0e70bacb4c9b107b82&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1333836" author="kevin.pulo@10gen.com" created="Mon, 25 Jul 2016 07:45:52 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=scotthernandez&quot; class=&quot;user-hover&quot; rel=&quot;scotthernandez&quot;&gt;scotthernandez&lt;/a&gt;, although it&apos;s related, I think the thing with setting minvalid while appropriate locks are held is more of a separate issue.  I&apos;ve filed &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-25248&quot; title=&quot;minvalid should be set while appropriate locks are held&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-25248&quot;&gt;&lt;del&gt;SERVER-25248&lt;/del&gt;&lt;/a&gt; for it because:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;It has separate impacts which are unrelated to shutdown (prevents meaningful backups of fsyncLocked secondaries)&lt;/li&gt;
	&lt;li&gt;It affects both 3.2 and master (whereas this ticket is just about master, with 3.2 covered by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-24933&quot; title=&quot;Clean shutdown of secondaries should occur in between oplog batches, not during&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-24933&quot;&gt;&lt;del&gt;SERVER-24933&lt;/del&gt;&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;I already had most of it written out (including the fsyncLock based repro steps) &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Together, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-25248&quot; title=&quot;minvalid should be set while appropriate locks are held&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-25248&quot;&gt;&lt;del&gt;SERVER-25248&lt;/del&gt;&lt;/a&gt; and this ticket mean that there&apos;s no reliable way to take a backup from a secondary.  Fixing either ticket would at least make some progress forward in this regard.&lt;/p&gt;

&lt;p&gt;However, I think it might be possible to shutdown during the &quot;way in&quot; race on &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-25248&quot; title=&quot;minvalid should be set while appropriate locks are held&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-25248&quot;&gt;&lt;del&gt;SERVER-25248&lt;/del&gt;&lt;/a&gt;, in which case that ticket would be more of a dependency for this one.  (It would probably also benefit from the &lt;tt&gt;inShutdownStrict()&lt;/tt&gt; check that was added to multiApply in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-24933&quot; title=&quot;Clean shutdown of secondaries should occur in between oplog batches, not during&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-24933&quot;&gt;&lt;del&gt;SERVER-24933&lt;/del&gt;&lt;/a&gt; &amp;#8212; the order would be: take fsyncLock mutex, take PBWM, check shutdown, write minvalid.)&lt;/p&gt;</comment>
                            <comment id="1333835" author="kevin.pulo@10gen.com" created="Mon, 25 Jul 2016 07:44:17 +0000"  >&lt;blockquote&gt;&lt;p&gt;while it is in this state, the node is invalid and has no (usable) data, until it can finish the batch. It cannot for example transition to secondary, nor become primary.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;More importantly (IMHO), it&apos;s not a useful backup for DR purposes.  This is a problem because a shutdown mongod is considered gold-standard in terms of being quiesced for the purposes of taking a backup.  Users rightly expect that a mongod which has been cleanly shutdown has data which is &quot;good&quot; in every way imaginable/possible.  For a replset, this includes consistency with the primary.  It will be quite shocking for the user who later discovers that the data they saved &amp;#8212; from a shutdown mongod &amp;#8212; is only useful &lt;em&gt;in the presence of other data&lt;/em&gt; which is stored on other hosts (or rather, &lt;em&gt;&lt;b&gt;was&lt;/b&gt; stored&lt;/em&gt; on other hosts...).&lt;/p&gt;

&lt;p&gt;The server has worked this way in all previous versions (including 3.2, once 3.2.9 has been released), so this feels more like a regression to me.&lt;/p&gt;</comment>
                            <comment id="1325137" author="scotthernandez" created="Fri, 15 Jul 2016 12:54:56 +0000"  >&lt;p&gt;When the member is restarted it cannot get to a consistent data set unless it can contact another consistent member so it can finish applying. In essence, while it is in this state, the node is invalid and has no (usable) data, until it can finish the batch. It cannot for example transition to secondary, nor become primary. &lt;/p&gt;

&lt;p&gt;The 3-node set, with a single arbiter, is a good example of a failure where losing the primary, and the secondary being in the middle of a batch during shutdown means you lose the ability to recover when the secondary and arbiter restart.&lt;/p&gt;</comment>
                            <comment id="1325134" author="schwerin" created="Fri, 15 Jul 2016 12:49:34 +0000"  >&lt;p&gt;What is the harm of shutting down mid-batch?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                        <issuelink>
            <issuekey id="335972">DOCS-9468</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="108228">SERVER-12528</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="299134">SERVER-24933</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="488085">SERVER-32935</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="288090">WT-2649</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="51775">SERVER-7200</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="303666">SERVER-25248</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_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 15 Jul 2016 12:49:34 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 years, 22 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-617</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>benety.goh@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 22 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kevin.pulo@mongodb.com</customfieldvalue>
            <customfieldvalue>mathias@mongodb.com</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrk2l3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsnl0v:</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="1022">Repl 2016-08-29</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrixn3:</customfieldvalue>

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