<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:16:47 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-27980] Secondary tries to rollback when it lagged to much behind primary</title>
                <link>https://jira.mongodb.org/browse/SERVER-27980</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In replication scenario when there is a lot of inserts on the primary node secondary is not always able to replicate all inserts in time. Documentation on &lt;a href=&quot;https://docs.mongodb.com/manual/reference/replica-states/#replstate.RECOVERING&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;RECOVERING state&lt;/a&gt; clearly says that in this situation secondary should transition to RECOVERING mode and manual intervention is required:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Due to overload, a secondary may fall far enough behind the other members of the replica set such that it may need to resync with the rest of the set. When this happens, the member enters the RECOVERING state and requires manual intervention.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;But in reality secondary node sometimes tries to rollback in this situation leading to failed rollback and wrong node state.&lt;/p&gt;

&lt;p&gt;I believe the problem is in &lt;tt&gt;BackgroundSync::_produce&lt;/tt&gt; function in &lt;tt&gt;src/mongo/db/repl/bgsync.cpp&lt;/tt&gt;. When &lt;tt&gt;OplogStartMissing&lt;/tt&gt; status code is returned by &lt;tt&gt;_syncSourceResolver&lt;/tt&gt; this function correctly transition node to &lt;tt&gt;RECOVERING&lt;/tt&gt; state. But when the same status code is returned by &lt;tt&gt;oplogFetcher&lt;/tt&gt; the code executes rollback without going to &lt;tt&gt;RECOVERING&lt;/tt&gt; state. I think oplog fetcher can return &lt;tt&gt;OplogStartMissing }} when the rollback is necessary or when secondary fall far behind primary. So there should be additional check if rollback is necessary or secondary should go to {{RECOVERING&lt;/tt&gt; state.&lt;/p&gt;
</description>
                <environment></environment>
        <key id="353449">SERVER-27980</key>
            <summary>Secondary tries to rollback when it lagged to much behind primary</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="3">Duplicate</resolution>
                                        <assignee username="mark.agarunov">Mark Agarunov</assignee>
                                    <reporter username="igorsol">Igor Solodovnikov</reporter>
                        <labels>
                    </labels>
                <created>Mon, 13 Feb 2017 12:33:31 +0000</created>
                <updated>Wed, 22 Feb 2017 09:37:37 +0000</updated>
                            <resolved>Tue, 21 Feb 2017 20:10:40 +0000</resolved>
                                    <version>3.4.1</version>
                                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="1505852" author="igorsol" created="Wed, 22 Feb 2017 09:37:37 +0000"  >&lt;p&gt;Hello @Mark Agarunov,&lt;/p&gt;

&lt;p&gt;Thank you for your comment.&lt;br/&gt;
sure, I will watch &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27403&quot; title=&quot;Consider term and rbid when validating the proposed sync source&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27403&quot;&gt;&lt;del&gt;SERVER-27403&lt;/del&gt;&lt;/a&gt; and I will recheck this issue when &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27403&quot; title=&quot;Consider term and rbid when validating the proposed sync source&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27403&quot;&gt;&lt;del&gt;SERVER-27403&lt;/del&gt;&lt;/a&gt; gets fixed.&lt;/p&gt;</comment>
                            <comment id="1505183" author="mark.agarunov" created="Tue, 21 Feb 2017 17:27:33 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=igorsol&quot; class=&quot;user-hover&quot; rel=&quot;igorsol&quot;&gt;igorsol&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thank you for the report. Looking over the provided output, the behavior you&apos;ve described appears to be due to the bug in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27403&quot; title=&quot;Consider term and rbid when validating the proposed sync source&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27403&quot;&gt;&lt;del&gt;SERVER-27403&lt;/del&gt;&lt;/a&gt;. The behavior is described in more &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27403?focusedCommentId=1466824&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-1466824&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;detail in this comment.&lt;/a&gt; Please watch &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-27403&quot; title=&quot;Consider term and rbid when validating the proposed sync source&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-27403&quot;&gt;&lt;del&gt;SERVER-27403&lt;/del&gt;&lt;/a&gt; if you would like to follow updates on this issue.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Mark&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="338476">SERVER-27403</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="356068">SERVER-28068</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>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 13 Feb 2017 18:36:47 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 51 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_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>igorsol</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            6 years, 51 weeks 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>igorsol</customfieldvalue>
            <customfieldvalue>mark.agarunov</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht2b5z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsuwrj:</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_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;To reproduce this situation I used modified version of &lt;tt&gt;zbigMapReduce.js&lt;/tt&gt; test. I changed specified oplog size from 50MB to 2MB. Then I executed test this way:&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;python buildscripts/resmoke.py --dbpathPrefix=~/ramd --executor=sharding --jobs=4 --storageEngine=wiredTiger jstests/sharding/zbigMapReduce.js&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;where &lt;tt&gt;~/ramd&lt;/tt&gt; is 4GB tmpfs partition.&lt;/p&gt;</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|hri7hz:</customfieldvalue>

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