<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:29:28 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-52950] recoverOplogAsStandalone mode must not start oplog truncater thread</title>
                <link>https://jira.mongodb.org/browse/SERVER-52950</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;This is observed on &lt;a href=&quot;https://github.com/mongodb/mongo/blob/abb1b353648260175c3dfe02ac8ae54c083956f7/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_mongod.cpp#L137&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;4.0&lt;/a&gt;, but I imagine applies to 4.4 and 4.2.&lt;/p&gt;

&lt;p&gt;The oplog truncater thread checks for readonly, but not for &lt;a href=&quot;https://github.com/mongodb/mongo/blob/abb1b353648260175c3dfe02ac8ae54c083956f7/src/mongo/db/repl/repl_settings.cpp#L42-L46&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;recoverFromOplogAsStandalone&lt;/a&gt;.  At startup with &lt;tt&gt;recoverFromOplogAsStandalone&lt;/tt&gt;, the node will open WT in read+write mode and perform replication recovery. After replication recovery, the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/abb1b353648260175c3dfe02ac8ae54c083956f7/src/mongo/db/repl/replication_coordinator_impl.cpp#L754-L756&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;readOnly&lt;/tt&gt; flag gets flipped&lt;/a&gt; to prevent external users from doing writes. &lt;/p&gt;

&lt;p&gt;Because the readonly flag is flipped after the oplog truncater thread is started up, the truncater thread can attempt to perform a write that will fail.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1546290">SERVER-52950</key>
            <summary>recoverOplogAsStandalone mode must not start oplog truncater thread</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="daniel.gottlieb@mongodb.com">Daniel Gottlieb</reporter>
                        <labels>
                    </labels>
                <created>Thu, 19 Nov 2020 19:28:11 +0000</created>
                <updated>Sun, 29 Oct 2023 22:00:15 +0000</updated>
                            <resolved>Mon, 7 Dec 2020 14:07:57 +0000</resolved>
                                                    <fixVersion>4.9.0</fixVersion>
                    <fixVersion>4.4.3</fixVersion>
                    <fixVersion>4.2.12</fixVersion>
                    <fixVersion>4.0.23</fixVersion>
                                    <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="3556474" author="xgen-internal-githook" created="Sat, 9 Jan 2021 17:05:52 +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-52950&quot; title=&quot;recoverOplogAsStandalone mode must not start oplog truncater thread&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-52950&quot;&gt;&lt;del&gt;SERVER-52950&lt;/del&gt;&lt;/a&gt; Add jstest tag for check_for_oplog_cap_maintainer_thread.js&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2516e9546b1b5df6e15d2f93e526e7218fa953f0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2516e9546b1b5df6e15d2f93e526e7218fa953f0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3556275" author="xgen-internal-githook" created="Sat, 9 Jan 2021 04:46:35 +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-52950&quot; title=&quot;recoverOplogAsStandalone mode must not start oplog truncater thread&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-52950&quot;&gt;&lt;del&gt;SERVER-52950&lt;/del&gt;&lt;/a&gt; recoverFromOplogAsStandalone mode must not start oplog truncater thread&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 3417215850d7a577452552499ea55d1872199d74)&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/8495ff679afa2c3a13d3456e3f3f1742d8431c85&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/8495ff679afa2c3a13d3456e3f3f1742d8431c85&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3536466" author="xgen-internal-githook" created="Fri, 18 Dec 2020 18:02:49 +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-52950&quot; title=&quot;recoverOplogAsStandalone mode must not start oplog truncater thread&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-52950&quot;&gt;&lt;del&gt;SERVER-52950&lt;/del&gt;&lt;/a&gt; recoverFromOplogAsStandalone mode must not start oplog truncater thread&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3417215850d7a577452552499ea55d1872199d74&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3417215850d7a577452552499ea55d1872199d74&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3527411" author="xgen-internal-githook" created="Mon, 14 Dec 2020 02:33:29 +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-52950&quot; title=&quot;recoverOplogAsStandalone mode must not start oplog truncater thread&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-52950&quot;&gt;&lt;del&gt;SERVER-52950&lt;/del&gt;&lt;/a&gt; Avoid calculating oplog stones when recoverFromOplogAsStandalone=true as the OplogCapMaintainerThread is not running&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 3be0c64532e121780dd11788fa3db4a9089b008c)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2146f93edb068f8020666cb0c495fc555a49415c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2146f93edb068f8020666cb0c495fc555a49415c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3517386" author="xgen-internal-githook" created="Sat, 5 Dec 2020 05:16:43 +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-52950&quot; title=&quot;recoverOplogAsStandalone mode must not start oplog truncater thread&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-52950&quot;&gt;&lt;del&gt;SERVER-52950&lt;/del&gt;&lt;/a&gt; Avoid calculating oplog stones when recoverFromOplogAsStandalone=true as the OplogCapMaintainerThread is not running&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/3be0c64532e121780dd11788fa3db4a9089b008c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/3be0c64532e121780dd11788fa3db4a9089b008c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3510702" author="gregory.wlodarek" created="Tue, 1 Dec 2020 17:00:36 +0000"  >&lt;p&gt;The change in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40168&quot; title=&quot;Pull the OplogTruncaterThread out of WiredTigerKVEngine and put it above the storage layer&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40168&quot;&gt;&lt;del&gt;SERVER-40168&lt;/del&gt;&lt;/a&gt; which resides in v4.4+ refactored the startup logic of the background thread. So the work will be slightly different when backporting this change to v4.2 and v4.0.&lt;/p&gt;

&lt;p&gt;In versions &amp;gt;= v4.4:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;initializeStorageControlsForReplication(), which initializes and starts the OplogCapMaintainerThread is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b40d4b7eaf6239f83b0d6fbcf27de520bfd89df4/src/mongo/db/repl/replication_coordinator_impl.cpp#L861-L864&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;only called when using --replSet and recoverFromOplogAsStandalone is false&lt;/a&gt;.
	&lt;ul&gt;
		&lt;li&gt;--replSet cannot be used in conjunction with --queryableBackupMode: &quot;Cannot specify both queryable backup mode and replication.replSet&quot;.&lt;/li&gt;
		&lt;li&gt;--repair terminates the process before the replication coordinator starts up.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;To avoid calculating oplog stones during startup when recoverFromOplogAsStandalone is true, an optimization can be &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b40d4b7eaf6239f83b0d6fbcf27de520bfd89df4/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp#L918-L921&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;made here&lt;/a&gt;. This will avoid unnecessary work and speed up startup.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;In versions &amp;lt; v4.4:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;During startup,&#160;initRsOplogBackgroundThread() is checked &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b9a24a72938e1b12431af8ca9bb9629a14314ea5/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp#L778-L780&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. This function is responsible for starting the&#160;OplogTruncaterThread if it isn&apos;t already running only &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b9a24a72938e1b12431af8ca9bb9629a14314ea5/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_mongod.cpp#L145-L154&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;when we&apos;re not in repair or read-only mode&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;All that&apos;s needed &lt;a href=&quot;https://github.com/mongodb/mongo/blob/b9a24a72938e1b12431af8ca9bb9629a14314ea5/src/mongo/db/storage/wiredtiger/wiredtiger_record_store_mongod.cpp#L150&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt; is to check whether the recoverFromOplogAsStandalone flag is set to true.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;tldr; versions &amp;gt;= v4.4 don&apos;t start the background thread but still calculate the oplog stones, and versions &amp;lt; v4.4 need to stop starting the background thread when recoverFromOplogAsStandalone=true.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.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_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="18953"><![CDATA[v4.4]]></customfieldvalue>
    <customfieldvalue key="16775"><![CDATA[v4.2]]></customfieldvalue>
    <customfieldvalue key="15640"><![CDATA[v4.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_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000s1czhQAA]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 1 Dec 2020 15:06:20 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 4 weeks, 4 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_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>
                            3 years, 4 weeks, 4 days ago
                        </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>daniel.gottlieb@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>gregory.wlodarek@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyi31z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr4ki7:</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="4329">Execution Team 2020-12-14</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|hyhpbb:</customfieldvalue>

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