<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:28:39 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-52661] lastDurable is set after it is cleared in initial sync</title>
                <link>https://jira.mongodb.org/browse/SERVER-52661</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When we start up a new initial sync attempt, it seems possible for &lt;tt&gt;lastDurable&lt;/tt&gt; to be set after it has been cleared. For example, this sequence:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;After an initial sync attempt, the last applied oplog entry is not yet durable&lt;/li&gt;
	&lt;li&gt;A new initial sync attempt starts and the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e4754b382d56446682799f400318c02c98cf6ab0/src/mongo/db/repl/initial_syncer.cpp#L600&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;oplogApplier in initial sync is shut down&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;The journaling thread gets the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e4754b382d56446682799f400318c02c98cf6ab0/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp#L294&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;lastApplied&lt;/tt&gt; from the replication coordinator&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/e4754b382d56446682799f400318c02c98cf6ab0/src/mongo/db/repl/initial_syncer.cpp#L607-L609&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;lastApplied&lt;/tt&gt; and &lt;tt&gt;lastDurable&lt;/tt&gt; are reset in the replication coordinator by initial sync&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/e4754b382d56446682799f400318c02c98cf6ab0/src/mongo/db/storage/wiredtiger/wiredtiger_session_cache.cpp#L302&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;lastDurable&lt;/tt&gt; is set to &lt;tt&gt;lastApplied&lt;/tt&gt;&lt;/a&gt; by the journaling thread&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;This was discovered after &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47898&quot; title=&quot;Advancing lastDurable irrespective of lastApplied&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47898&quot;&gt;&lt;del&gt;SERVER-47898&lt;/del&gt;&lt;/a&gt;. In that ticket, if we set &lt;tt&gt;lastDurable&lt;/tt&gt;, we will also advance &lt;tt&gt;lastApplied&lt;/tt&gt;. Thus, &lt;tt&gt;lastApplied&lt;/tt&gt; would be set after the above sequence occurs. After that, we would go into &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e4754b382d56446682799f400318c02c98cf6ab0/src/mongo/db/repl/initial_syncer.cpp#L553&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this invariant&lt;/a&gt;, which would fail.&lt;/p&gt;

&lt;p&gt;Just as a small note, it seems like unexpectedly setting &lt;tt&gt;lastDurable&lt;/tt&gt; hasn&apos;t been causing noticeable issues until now. &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47898&quot; title=&quot;Advancing lastDurable irrespective of lastApplied&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47898&quot;&gt;&lt;del&gt;SERVER-47898&lt;/del&gt;&lt;/a&gt; was reverted after a few days, and the BFs from the invariant failing also went away after it was reverted.&lt;/p&gt;

&lt;p&gt;CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=lingzhi.deng&quot; class=&quot;user-hover&quot; rel=&quot;lingzhi.deng&quot;&gt;lingzhi.deng&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=matthew.russotto&quot; class=&quot;user-hover&quot; rel=&quot;matthew.russotto&quot;&gt;matthew.russotto&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1535935">SERVER-52661</key>
            <summary>lastDurable is set after it is cleared in initial sync</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="backlog-server-repl">Backlog - Replication Team</assignee>
                                    <reporter username="xuerui.fa@mongodb.com">Xuerui Fa</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Nov 2020 16:16:55 +0000</created>
                <updated>Tue, 6 Dec 2022 01:45:45 +0000</updated>
                            <resolved>Fri, 6 Nov 2020 17:23:53 +0000</resolved>
                                    <version>4.9 Required</version>
                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="3479841" author="lingzhi.deng" created="Fri, 6 Nov 2020 17:12:26 +0000"  >&lt;p&gt;Good catch Xuerui. Yes, the journal flusher sets lastDurable asynchronously, which could be out of sync with the repl states. This type of issue also appeared in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50949&quot; title=&quot;waitUntilDurable call spanning rollback can set lastDurable ahead of journaling&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50949&quot;&gt;&lt;del&gt;SERVER-50949&lt;/del&gt;&lt;/a&gt;. Similar to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50949&quot; title=&quot;waitUntilDurable call spanning rollback can set lastDurable ahead of journaling&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50949&quot;&gt;&lt;del&gt;SERVER-50949&lt;/del&gt;&lt;/a&gt;, we may need to find a way to either stop/pause/restart the journal flusher after each failed initial attempt or make &lt;a href=&quot;https://github.com/mongodb/mongo/blob/2317871d1b0630bcf6cd01de538bae2c7dec15bf/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp#L1084-L1094&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;getToken()&lt;/tt&gt; return an empty token during initial sync.&lt;/a&gt;. I think more investigation needs to be done together with &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47898&quot; title=&quot;Advancing lastDurable irrespective of lastApplied&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47898&quot;&gt;&lt;del&gt;SERVER-47898&lt;/del&gt;&lt;/a&gt;. But I believe this is probably not a bug now without &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47898&quot; title=&quot;Advancing lastDurable irrespective of lastApplied&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47898&quot;&gt;&lt;del&gt;SERVER-47898&lt;/del&gt;&lt;/a&gt; because we would simply ignore setting lastDurable to an OpTime higher than lastApplied.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1336424">SERVER-47898</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>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25128"><![CDATA[Replication]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 6 Nov 2020 17:12:26 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 13 weeks, 5 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_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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 13 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>56.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>backlog-server-repl</customfieldvalue>
            <customfieldvalue>lingzhi.deng@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|hygcdr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hy2fc7:</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_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|hyfyn3:</customfieldvalue>

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