<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:04:43 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>[DOCS-12230] Manual oplog resize in 4.0 after unclean shutdown can lose committed writes</title>
                <link>https://jira.mongodb.org/browse/DOCS-12230</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;h2&gt;&lt;a name=&quot;Description&quot;&gt;&lt;/a&gt;Description&lt;/h2&gt;
&lt;p&gt;This is a specific manifestation of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38174&quot; title=&quot;Starting replica set member standalone can lose committed writes starting in MongoDB 4.0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38174&quot;&gt;&lt;del&gt;SERVER-38174&lt;/del&gt;&lt;/a&gt; that wasn&apos;t considered on that ticket.&lt;/p&gt;

&lt;p&gt;Until (and including) 3.4, the &lt;a href=&quot;https://docs.mongodb.com/v3.4/tutorial/change-oplog-size/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;supported and documented procedure to resize the oplog&lt;/a&gt; involved:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;restarting as a standalone,&lt;/li&gt;
	&lt;li&gt;saving the last oplog entry,&lt;/li&gt;
	&lt;li&gt;dropping the oplog,&lt;/li&gt;
	&lt;li&gt;recreating the oplog,&lt;/li&gt;
	&lt;li&gt;adding the saved oplog entry.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In &lt;a href=&quot;https://docs.mongodb.com/v3.6/tutorial/change-oplog-size/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;3.6 this was changed to a &quot;live resize&quot;&lt;/a&gt; using the replSetResizeOplog command.&lt;/p&gt;

&lt;p&gt;However, if the old manual resize procedure is performed on an uncleanly shutdown 4.0 mongod, it can result in unapplied oplog entries being lost.  This will cause the data on that node to no longer be consistent with the rest of the replica set (which can in turn lead to unspecified problems later on).&lt;/p&gt;


&lt;p&gt;&lt;b&gt;Reproducer:&lt;/b&gt;&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Start a 2 member replset.&lt;/li&gt;
	&lt;li&gt;Run the attached &lt;tt&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/attachment/202418/202418_check-confirmed.js&quot; title=&quot;check-confirmed.js attached to DOCS-12230&quot;&gt;check-confirmed.js&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.mongodb.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/tt&gt; script against the primary.&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;kill -9&lt;/tt&gt; the primary.&lt;/li&gt;
	&lt;li&gt;Restart the primary as a standalone.&lt;/li&gt;
	&lt;li&gt;Confirm there are at least 2 unapplied oplog entries, ie. the _id values mentioned by the last &amp;gt;= 2 oplog entries have different (old) values in the collection.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://docs.mongodb.com/v3.4/tutorial/change-oplog-size/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Manually resize the oplog&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;Return the member to the replset.&lt;/li&gt;
	&lt;li&gt;Query for the _ids of the affected unapplied oplog entries (except the final oplog entry).  The affected node will have the old value, whereas the other node will have the correct value.&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;&lt;b&gt;Remediation:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Given that the old procedure has been around forever, it&apos;s reasonable to believe that experienced MongoDB admins:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;might not be aware of the change in documented procedure&lt;/li&gt;
	&lt;li&gt;might perform the procedure on 4.0+ replica set members.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;It&apos;s also not hard to imagine scenarios where this might be done after an unclean shutdown, for example, an admin wanting to reduce the size of the oplog after an out-of-disk-space crash.&lt;/p&gt;

&lt;p&gt;This ticket is to request:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Entry in the &lt;a href=&quot;https://docs.mongodb.com/manual/release-notes/4.0/#replica-set&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Replica Sets section of the 4.0 Release Notes&lt;/a&gt; mentioning that manually resizing the oplog is not safe in 4.0, and therefore the NEW replSetResizeOplog procedure must be used instead.&lt;/li&gt;
	&lt;li&gt;Adjust the replSetResizeOplog entry in the &lt;a href=&quot;https://docs.mongodb.com/manual/release-notes/3.6/#replica-set&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Replica Sets section of the 3.6 Release Notes&lt;/a&gt; to mention that for storage engines which support this command, manually resizing the oplog is no longer supported.&lt;/li&gt;
	&lt;li&gt;Admonishments on the old procedure (3.4 and earlier branches) stating that it is not safe to perform on 4.0+ replica set members.&lt;/li&gt;
	&lt;li&gt;Admonishments on the new procedure (3.6 and later branches) stating that it is not safe to perform the OLD procedure on 4.0+ replica set members, and that the NEW replSetResizeOplog procedure MUST be used.&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;&lt;a name=&quot;Scopeofchanges&quot;&gt;&lt;/a&gt;Scope of changes&lt;/h2&gt;

&lt;h2&gt;&lt;a name=&quot;ImpacttoOtherDocs&quot;&gt;&lt;/a&gt;Impact to Other Docs&lt;/h2&gt;

&lt;h2&gt;&lt;a name=&quot;MVP%28WorkandDate%29&quot;&gt;&lt;/a&gt;MVP (Work and Date)&lt;/h2&gt;

&lt;h2&gt;&lt;a name=&quot;Resources%28ScopeorDesignDocs%2CInvision%2Cetc.%29&quot;&gt;&lt;/a&gt;Resources (Scope or Design Docs, Invision, etc.)&lt;/h2&gt;
</description>
                <environment></environment>
        <key id="641798">DOCS-12230</key>
            <summary>Manual oplog resize in 4.0 after unclean shutdown can lose committed writes</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="ravind.kumar">Ravind Kumar</assignee>
                                    <reporter username="kevin.pulo@mongodb.com">Kevin Pulo</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Dec 2018 03:33:31 +0000</created>
                <updated>Mon, 30 Oct 2023 20:50:26 +0000</updated>
                                                            <fixVersion>Server_Docs_20231030</fixVersion>
                                    <component>manual</component>
                    <component>Rel Notes</component>
                    <component>Server</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="4940531" author="edu.bot" created="Mon, 31 Oct 2022 16:06:42 +0000"  >&lt;p&gt;Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!&lt;/p&gt;</comment>
                            <comment id="2098744" author="asya" created="Fri, 21 Dec 2018 18:50:54 +0000"  >&lt;p&gt;I&apos;d like to second that adding a &quot;WARNING&quot; block to the 3.4 and earlier version of the oplog resize page about this is super-important.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="634991">SERVER-38174</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="641799">SERVER-38356</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="202418" name="check-confirmed.js" size="459" author="kevin.pulo@mongodb.com" created="Mon, 3 Dec 2018 03:33:01 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 21 Dec 2018 18:50:54 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 14 weeks, 2 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>DOCSP-1769</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>emet.ozar@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 14 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>edu.bot</customfieldvalue>
            <customfieldvalue>kevin.pulo@mongodb.com</customfieldvalue>
            <customfieldvalue>ravind.kumar</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hue8hj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu4bpb:</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_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.2</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_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|huduqv:</customfieldvalue>

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