<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:17:02 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-28068] Do not go into rollback due to falling off the back of your sync source&apos;s oplog</title>
                <link>https://jira.mongodb.org/browse/SERVER-28068</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently we treat falling off the back of the oplog the same as being on a divergent branch of history &lt;a href=&quot;https://github.com/mongodb/mongo/blob/499d5f22e2b08e66ae9d7f60f5ecc13088d06082/src/mongo/db/repl/oplog_fetcher.cpp#L173&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. Before deciding to go into rollback, we should check if we&apos;ve fallen off the back of our sync source&apos;s oplog and if so switch sync sources (with an InvalidSyncSource error) instead of rolling back (OplogStartMissing error). We can do this exactly the same as how it&apos;s done in the SyncSourceResolver by comparing our last fetched optime to the sync source&apos;s oldest optime. &lt;/p&gt;</description>
                <environment></environment>
        <key id="356068">SERVER-28068</key>
            <summary>Do not go into rollback due to falling off the back of your sync source&apos;s oplog</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="9">Done</resolution>
                                        <assignee username="xuerui.fa@mongodb.com">Xuerui Fa</assignee>
                                    <reporter username="judah.schvimer@mongodb.com">Judah Schvimer</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Feb 2017 22:21:56 +0000</created>
                <updated>Tue, 8 Nov 2022 14:44:06 +0000</updated>
                            <resolved>Thu, 21 May 2020 18:51:21 +0000</resolved>
                                                    <fixVersion>4.7.0</fixVersion>
                                    <component>Replication</component>
                                        <votes>1</votes>
                                    <watches>23</watches>
                                                                                                                <comments>
                            <comment id="3102982" author="xgen-internal-githook" created="Thu, 21 May 2020 18:49:21 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Xuerui Fa&apos;, &apos;email&apos;: &apos;xuerui.fa@mongodb.com&apos;, &apos;username&apos;: &apos;XueruiFa&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28068&quot; title=&quot;Do not go into rollback due to falling off the back of your sync source&amp;#39;s oplog&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-28068&quot;&gt;&lt;del&gt;SERVER-28068&lt;/del&gt;&lt;/a&gt;: Prevent nodes from going into rollback due to falling off the sync source&apos;s oplog&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/7812887269d1623159c541f01b61e99f359cec0b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/7812887269d1623159c541f01b61e99f359cec0b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2177316" author="judah.schvimer" created="Mon, 11 Mar 2019 17:07:28 +0000"  >&lt;p&gt;This will likely be much less important after the initial sync semantics project, since nodes will no longer fall off the back of their sync sources&apos; oplogs, at least in Atlas.&lt;/p&gt;</comment>
                            <comment id="2176192" author="judah.schvimer" created="Fri, 8 Mar 2019 19:36:16 +0000"  >&lt;p&gt;In discussion with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jason.chan&quot; class=&quot;user-hover&quot; rel=&quot;jason.chan&quot;&gt;jason.chan&lt;/a&gt; I realized that this is more common than I previously thought. If the oplog fetching cursor is killed due to falling off the back of the oplog, it will return an error to the &lt;tt&gt;OplogFetcher&lt;/tt&gt; causing the node to retry it&apos;s &lt;tt&gt;find&lt;/tt&gt; command on the oplog. This doesn&apos;t go through sync source resolution, so it will go into rollback instead of seeing that it&apos;s fallen off its sync source&apos;s oplog. &lt;/p&gt;

&lt;p&gt;One way to easily disambiguate these cases is by checking the term. I think we can check the term of the two oplog entries &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4cc82e953bcfcb355cccf47ba5bb696e7aa7a057/src/mongo/db/repl/oplog_fetcher.cpp#L207-L211&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;. If the terms are the same, I think it definitely means we fell off the back of our sync source&apos;s oplog since we are on the same branch of history. This doesn&apos;t make it so we never go into rollback when we fell off the back of our sync source&apos;s oplog, but it does fix it in almost all occurrences where there are not frequent term changes.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=siyuan.zhou&quot; class=&quot;user-hover&quot; rel=&quot;siyuan.zhou&quot;&gt;siyuan.zhou&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt;, thoughts? I still don&apos;t think this is high priority, since this is rare and changing sync sources isn&apos;t so likely to save the lagging node.&lt;/p&gt;</comment>
                            <comment id="1741951" author="xgen-internal-githook" created="Mon, 4 Dec 2017 19:26:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;xdg&apos;, &apos;email&apos;: &apos;xdg@xdg.me&apos;, &apos;name&apos;: &apos;David Golden&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/TOOLS-1895&quot; title=&quot;qa-dump-restore-archiving oplog_rollover_test.js&quot; class=&quot;issue-link&quot; data-issue-key=&quot;TOOLS-1895&quot;&gt;&lt;del&gt;TOOLS-1895&lt;/del&gt;&lt;/a&gt; test oplog rollover with 1-node replica set&lt;/p&gt;

&lt;p&gt;This avoids a bug due to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28068&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-28068&lt;/a&gt;&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-tools/commit/e55ffc4a4f884ec8b608cc0bda632f76b25c7f2e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-tools/commit/e55ffc4a4f884ec8b608cc0bda632f76b25c7f2e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1741932" author="xgen-internal-githook" created="Mon, 4 Dec 2017 19:24:04 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;xdg&apos;, &apos;email&apos;: &apos;xdg@xdg.me&apos;, &apos;name&apos;: &apos;David Golden&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/TOOLS-1895&quot; title=&quot;qa-dump-restore-archiving oplog_rollover_test.js&quot; class=&quot;issue-link&quot; data-issue-key=&quot;TOOLS-1895&quot;&gt;&lt;del&gt;TOOLS-1895&lt;/del&gt;&lt;/a&gt; test oplog rollover with 1-node replica set&lt;/p&gt;

&lt;p&gt;This avoids a bug due to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28068&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-28068&lt;/a&gt;&lt;br/&gt;
Branch: v3.6-master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-tools/commit/e55ffc4a4f884ec8b608cc0bda632f76b25c7f2e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-tools/commit/e55ffc4a4f884ec8b608cc0bda632f76b25c7f2e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1737586" author="xgen-internal-githook" created="Wed, 29 Nov 2017 18:02:30 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;David Golden&apos;, &apos;username&apos;: &apos;xdg&apos;, &apos;email&apos;: &apos;xdg@xdg.me&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/TOOLS-1895&quot; title=&quot;qa-dump-restore-archiving oplog_rollover_test.js&quot; class=&quot;issue-link&quot; data-issue-key=&quot;TOOLS-1895&quot;&gt;&lt;del&gt;TOOLS-1895&lt;/del&gt;&lt;/a&gt; test oplog rollover with 1-node replica set&lt;/p&gt;

&lt;p&gt;This avoids a bug due to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-28068&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/SERVER-28068&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-tools/commit/e55ffc4a4f884ec8b608cc0bda632f76b25c7f2e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-tools/commit/e55ffc4a4f884ec8b608cc0bda632f76b25c7f2e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1523608" author="judah.schvimer" created="Tue, 14 Mar 2017 15:06:39 +0000"  >&lt;p&gt;No it is still possible. When this happens we will always get an &lt;tt&gt;UnrecoverableRollbackException&lt;/tt&gt; and crash, so I do not think we will ever rollback writes that shouldn&apos;t be rolled back. Additionally, this happens when our sync source is a valid sync source besides being too far ahead, so we should trust its history. &lt;/p&gt;</comment>
                            <comment id="1520411" author="crystal.horn@10gen.com" created="Thu, 9 Mar 2017 20:55:02 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=judah.schvimer&quot; class=&quot;user-hover&quot; rel=&quot;judah.schvimer&quot;&gt;judah.schvimer&lt;/a&gt;, was this done in your recent commit?  Can this be closed now?&lt;/p&gt;</comment>
                            <comment id="1505649" author="spencer" created="Tue, 21 Feb 2017 23:50:56 +0000"  >&lt;p&gt;Okay, yeah, I guess it would indeed be better to behave as we do when we come up already too stale to sync from anyone, which is that we log that we are too stale and then go into RECOVERING (and will continue to look for viable sync sources to become available, after &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-26360&quot; title=&quot;After node goes into RECOVERING due to being too stale to sync from its source, it will never recover even if there is a valid sync source it could use&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-26360&quot;&gt;&lt;del&gt;SERVER-26360&lt;/del&gt;&lt;/a&gt; is fixed).&lt;/p&gt;</comment>
                            <comment id="1505628" author="judah.schvimer" created="Tue, 21 Feb 2017 23:23:19 +0000"  >&lt;p&gt;We can&apos;t find a common point, get an &lt;tt&gt;UnrecoverableRollbackException&lt;/tt&gt;, and fassert. &lt;/p&gt;</comment>
                            <comment id="1505571" author="spencer" created="Tue, 21 Feb 2017 22:30:12 +0000"  >&lt;p&gt;What&apos;s the current behavior if we go into ROLLBACK but then are too stale to sync from anyone?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="511278">SERVER-33878</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1301851">SERVER-47271</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1301853">SERVER-47272</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="338476">SERVER-27403</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="353449">SERVER-27980</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2177143">SERVER-71156</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="511278">SERVER-33878</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>11.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.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[[5002K00000dOZZ2QAO, 500A000000bQyamIAC, 500A000000Z1pXyIAJ, 5002K00000dEffiQAC, 5002K00000ejRRZQA2, 5002K00000hvftMQAQ, 5002K00000oauxrQAA]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 21 Feb 2017 22:30:12 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 37 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>crystal.horn@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>spencer@mongodb.com</customfieldvalue>
            <customfieldvalue>xuerui.fa@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht2r8n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsvb7r:</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="3769">Repl 2020-04-20</customfieldvalue>
    <customfieldvalue id="3881">Repl 2020-05-04</customfieldvalue>
    <customfieldvalue id="3882">Repl 2020-05-18</customfieldvalue>
    <customfieldvalue id="3934">Repl 2020-06-01</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|hs4g3b:</customfieldvalue>

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