<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:40:59 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-35786] lastDurable optime should be updated after batch application on non-durable storage engines</title>
                <link>https://jira.mongodb.org/browse/SERVER-35786</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;For secondary batch application, the ApplyBatchFinalizer is used to advance optimes after application of an oplog batch completes. We &lt;a href=&quot;https://github.com/mongodb/mongo/blob/f9f33683b6ec5995091ee214c81d75c0ab163fe4/src/mongo/db/repl/sync_tail.cpp#L786-L789&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;currently use&lt;/a&gt; the ApplyBatchFinalizerForJournal for durable storage engines and the ApplyBatchFinalizer for non-durable storage engines, which &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/repl/sync_tail.cpp#L105-L132&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;only updates the lastApplied optime&lt;/a&gt;. On primaries, for non-durable storage engines, the replication system keeps the lastDurable optime up to date wth the lastApplied optime, since the lastDurable optime has no functional meaning on a non-durable storage engine. It seems we should be keeping this behavior consistent between primaries and secondaries, so we should update the lastDurable optime on batch application on non-durable storage engines.&lt;/p&gt;</description>
                <environment></environment>
        <key id="563948">SERVER-35786</key>
            <summary>lastDurable optime should be updated after batch application on non-durable storage engines</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-server-repl">Backlog - Replication Team</assignee>
                                    <reporter username="william.schultz@mongodb.com">William Schultz</reporter>
                        <labels>
                            <label>former-quick-wins</label>
                    </labels>
                <created>Mon, 25 Jun 2018 19:41:53 +0000</created>
                <updated>Tue, 6 Dec 2022 03:25:34 +0000</updated>
                                                                            <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>13</watches>
                                                                                                                <comments>
                            <comment id="1989221" author="spencer" created="Wed, 29 Aug 2018 19:19:35 +0000"  >&lt;p&gt;Spent some time investigating the current behavior here and it&apos;s a bit interesting. The following describes the behavior of a single inserts with various configurations and writeConcerns specified&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Primary inMemory, Secondary WT, writeConcernMajorityJournalDefault: true&lt;/em&gt;&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;No writeConcern specified: No error, lastApplied updated but not lastDurable on the primary, both lastApplied and lastDurable updated on secondary&lt;/li&gt;
	&lt;li&gt;w:majority without &apos;j&apos; specified: No error, both lastApplied and lastDurable advance on both nodes.&lt;/li&gt;
	&lt;li&gt;w:majority with j: true specified explicitly: Error &quot;cannot use &apos;j&apos; option when a host does not have journaling enabled&quot; returned.&#160; No write is performed so no optimes advance.&lt;/li&gt;
	&lt;li&gt;w:majority with j:false specified: write is successful, writeConcern times out.&#160; lastApplied is updated but not lastDurable on primary, both updated on secondary.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;#2 here I believe can be explained by &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ebb653a9bdcb6ba1f1d4cc8113d32cdb86e6d2bb/src/mongo/db/write_concern.cpp#L201&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this line&lt;/a&gt;, which waits for durability and then unconditionally sets lastOpDurable to the lastApplied.&#160; This seems like problematic behavior however since j wasn&apos;t specified and writeConcernMajorityJournalDefault is true I&apos;d expect this to error in some way.&lt;br/&gt;
 #4 above is pretty surprising, and I haven&apos;t looked into yet why this is the behavior.&lt;/p&gt;

&lt;p&gt;&#160;&lt;br/&gt;
 &lt;em&gt;Primary WT, Secondary inMemory, writeConcernMajorityJournalDefault: true&lt;/em&gt;&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;No writeConcern specified: No error, both OpTimes advanced on primary, lastApplied but not lastDurable updated on secondary&lt;/li&gt;
	&lt;li&gt;w:majority without &apos;j&apos; specified: Write is successful, writeConcern times out. Both OpTimes advanced on primary, lastApplied but not lastDurable updated on secondary&lt;/li&gt;
	&lt;li&gt;w:majority with j: true specified explicitly: Write is successful, writeConcern times out. Both OpTimes advanced on primary, lastApplied but not lastDurable updated on secondary&lt;/li&gt;
	&lt;li&gt;w:majority with j:false specified: Write is successful, writeConcern times out. Both OpTimes advanced on primary, lastApplied but not lastDurable updated on secondary&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;All 4 cases behave the same. It&apos;s a bit surprising that #4 still errors even though j:false is specified.&lt;/p&gt;

&lt;p&gt;&#160;&lt;br/&gt;
 &lt;em&gt;Primary WT, Secondary inMemory, writeConcernMajorityJournalDefault: false&lt;/em&gt;&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;No writeConcern specified: No error, both OpTimes advanced on primary, lastApplied but not lastDurable updated on secondary&lt;/li&gt;
	&lt;li&gt;w:majority without &apos;j&apos; specified: No error, both OpTimes advanced on primary, lastApplied but not lastDurable updated on secondary&lt;/li&gt;
	&lt;li&gt;w:majority with j: true specified explicitly: Write is successful, writeConcern times out. Both OpTimes advanced on primary, lastApplied but not lastDurable updated on secondary&lt;/li&gt;
	&lt;li&gt;w:majority with j:false specified: No error, both OpTimes advanced on primary, lastApplied but not lastDurable updated on secondary&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;No surprises here&lt;/p&gt;

&lt;p&gt;&#160;&lt;br/&gt;
 &lt;em&gt;Primary inMemory, Secondary WT, writeConcernMajorityJournalDefault: false&lt;/em&gt;&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;No writeConcern specified: No error, lastApplied updated but not lastDurable on the primary, both lastApplied and lastDurable updated on secondary&lt;/li&gt;
	&lt;li&gt;w:majority without &apos;j&apos; specified: No error, lastApplied updated but not lastDurable on the primary, both lastApplied and lastDurable updated on secondary&lt;/li&gt;
	&lt;li&gt;w:majority with j: true specified explicitly: Error &quot;cannot use &apos;j&apos; option when a host does not have journaling enabled&quot; returned.&#160; No write is performed so no optimes advance.&lt;/li&gt;
	&lt;li&gt;w:majority with j:false specified: No error, lastApplied updated but not lastDurable on the primary, both lastApplied and lastDurable updated on secondary&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;No surprises here.&lt;/p&gt;</comment>
                            <comment id="1938123" author="tess.avitabile" created="Tue, 3 Jul 2018 18:18:06 +0000"  >&lt;p&gt;We should investigate whether having an in-memory primary node keep lastDurable up to date with lastApplied causes us to incorrectly confirm majority (durable) writes.&lt;/p&gt;</comment>
                            <comment id="1931055" author="william.schultz" created="Mon, 25 Jun 2018 20:08:49 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt; I came across this behavior when diagnosing a build failure that occurred specifically on the ephemeralForTest storage engine. What I observed was that the lastDurable optime on a secondary was not advancing during normal steady state replication, but an update to it was later triggered by another (internal) write happening in the system; in this case it was the writing of our &quot;last vote&quot; document to storage. This then seemed to cause the durable optime to advance, and because of this, we &lt;a href=&quot;https://github.com/mongodb/mongo/blob/5339c9a55181662545652ab7106c8f4e55109327/src/mongo/db/repl/replication_coordinator_impl.cpp#L1078-L1082&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;triggered an updatePosition request&lt;/a&gt; to our sync source, which ended up interfering with other commands in an unintended way (&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35766&quot; title=&quot;Replication commands sent in candidate&amp;#39;s new term can interrupt concurrent vote request&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35766&quot;&gt;&lt;del&gt;SERVER-35766&lt;/del&gt;&lt;/a&gt;). That isn&apos;t explicitly related to this issue, but that is how I discovered this. When I noticed that we weren&apos;t updating our lastDurable optime during batch application, it seemed incorrect. Perhaps the behavior I was observing could also be due to an ephemeralForTest engine bug? I wasn&apos;t entirely sure.&lt;/p&gt;

&lt;p&gt;Maybe the existing behavior is acceptable, but I suppose we should at least decide what we want the behavior to be, since it certainly appears that we try to keep lastDurable optimes up to date with lastApplied optimes on the primary.&lt;/p&gt;</comment>
                            <comment id="1931029" author="milkie" created="Mon, 25 Jun 2018 19:49:54 +0000"  >&lt;p&gt;I&apos;m not sure we should be making this change unless there&apos;s an advantage to making it.  I suspect it won&apos;t be trivial to change this behavior, and it will change the use of writeConcernMajorityJournalDefault parameter, since you would no longer need to change it when setting up a replica set with nondurable nodes.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="266491">SERVER-22728</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="629750">SERVER-37943</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="656681">SERVER-38685</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <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>4.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_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>Mon, 25 Jun 2018 19:49:54 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 24 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>17.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>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>spencer@mongodb.com</customfieldvalue>
            <customfieldvalue>tess.avitabile@mongodb.com</customfieldvalue>
            <customfieldvalue>william.schultz@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu1e0n:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr5o1j:</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="2384">Repl 2018-07-30</customfieldvalue>
    <customfieldvalue id="2447">Repl 2018-08-13</customfieldvalue>
    <customfieldvalue id="2448">Repl 2018-08-27</customfieldvalue>
    <customfieldvalue id="2483">Repl 2018-09-10</customfieldvalue>

                        </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|hu109z:</customfieldvalue>

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