<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:12:15 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-46721] Step up may cause reads at PIT with holes after yielding</title>
                <link>https://jira.mongodb.org/browse/SERVER-46721</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When we acquire collection locks with &lt;tt&gt;AutoGetCollectionForRead&lt;/tt&gt; on a secondary, we set the &lt;tt&gt;TimestampReadSource&lt;/tt&gt; on the recovery unit to &lt;tt&gt;kLastApplied&lt;/tt&gt; if we were a secondary at the time. However, when we re-acquire locks after a yield in &lt;tt&gt;PlanExecutor&lt;/tt&gt;, we use the same &lt;tt&gt;TimestampReadSource&lt;/tt&gt; we had when we originally acquired those locks, even we&apos;ve become a primary since. This is bad for the oplog specifically, because on a primary, the last applied time is not oplog-hole-free, meaning we can read past oplog holes. More in general, we should not read at a PIT if there are still write transactions that may commit at that PIT.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Suggested fix:&lt;/b&gt; Have secondary reads use the &lt;tt&gt;kNoOverlap&lt;/tt&gt; read source instead of &lt;tt&gt;kLastApplied&lt;/tt&gt;, which is &lt;tt&gt;std::min(*lastApplied, allDurable)&lt;/tt&gt;. This is the same as &lt;tt&gt;kLastApplied&lt;/tt&gt; while a node is remains secondary, but is equivalent to &lt;tt&gt;kAllDurableSnapshot&lt;/tt&gt; after transition to primary.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1253817">SERVER-46721</key>
            <summary>Step up may cause reads at PIT with holes after yielding</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13201">Fixed</resolution>
                                        <assignee username="louis.williams@mongodb.com">Louis Williams</assignee>
                                    <reporter username="geert.bosch@mongodb.com">Geert Bosch</reporter>
                        <labels>
                    </labels>
                <created>Mon, 9 Mar 2020 17:33:07 +0000</created>
                <updated>Sun, 29 Oct 2023 22:11:05 +0000</updated>
                            <resolved>Tue, 12 May 2020 18:19:16 +0000</resolved>
                                                    <fixVersion>4.4.0-rc7</fixVersion>
                    <fixVersion>4.2.9</fixVersion>
                    <fixVersion>4.7.0</fixVersion>
                                    <component>Concurrency</component>
                                        <votes>0</votes>
                                    <watches>11</watches>
                                                                                                                <comments>
                            <comment id="3324809" author="xgen-internal-githook" created="Thu, 6 Aug 2020 16:07:10 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46721&quot; title=&quot;Step up may cause reads at PIT with holes after yielding&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46721&quot;&gt;&lt;del&gt;SERVER-46721&lt;/del&gt;&lt;/a&gt; Secondary readers should read at the no-overlap time instead of lastApplied&lt;/p&gt;

&lt;p&gt;The no-overlap time, ReadSource::kNoOverlap, is the minimum of replication&apos;s lastApplied timestamp&lt;br/&gt;
and WiredTiger&apos;s all_durable time. This time is independent of replication state and ensures&lt;br/&gt;
queries do not see oplog holes after state transitions from secondary to primary.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 25c694f365db0f07a445bd17b6cd5cbf32f5f2f9)&lt;br/&gt;
(cherry picked from commit 5ddf9db5635e4af2d1295bd2f1007e86d517c6c2)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44529&quot; title=&quot;Re-acquiring locks after a yield and step down results in wrong parameters on recoveryUnit&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44529&quot;&gt;&lt;del&gt;SERVER-44529&lt;/del&gt;&lt;/a&gt; Query yield recovery after a stepdown should switch to read at the no-overlap time&lt;/p&gt;

&lt;p&gt;After yielding and reacquiring locks in a query, the preconditions that were used to select our&lt;br/&gt;
ReadSource initially need to be checked again. Queries hold an AutoGetCollectionForRead RAII&lt;br/&gt;
lock for their lifetime, which may select a ReadSource based on state (e.g. replication&lt;br/&gt;
state). After a query yields its locks, this state may have changed, invalidating our current&lt;br/&gt;
choice of ReadSource.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit b3a5b5258a487006f0487b9e7e0a1d0d4f1119ff)&lt;br/&gt;
(cherry picked from commit ce57ddce19e642401ec1b56871b3a9402116ccfc)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48475&quot; title=&quot;Secondary reads always calculate all_durable despite only using lastApplied&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48475&quot;&gt;&lt;del&gt;SERVER-48475&lt;/del&gt;&lt;/a&gt; Reimplement lastApplied for secondary reads&lt;/p&gt;

&lt;p&gt;This partially reverts work to use the kNoOverlap ReadSource on secondaries since the all_durable&lt;br/&gt;
calculation is unnecessary and expensive.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit ff92d4435fa75c2b947c49cffaf48805b320a5ae)&lt;br/&gt;
(cherry picked from commit 4e3f3b96826772baa777b7563b38574c1e11c2e4)&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/caef6619556ddeb20adf8e2bad651b96d2b3ea70&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/caef6619556ddeb20adf8e2bad651b96d2b3ea70&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3196975" author="louis.williams" created="Tue, 9 Jun 2020 13:27:24 +0000"  >&lt;p&gt;Due to a small performance regression, I have partially reverted this work in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48475&quot; title=&quot;Secondary reads always calculate all_durable despite only using lastApplied&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48475&quot;&gt;&lt;del&gt;SERVER-48475&lt;/del&gt;&lt;/a&gt;. Secondary reads no longer use kNoOverlap, but use kLastApplied like they did before. Since the no-overlap point on secondaries is always equal to lastApplied, we were performing unnecessary all_durable calculations for every read.&lt;/p&gt;</comment>
                            <comment id="3095398" author="xgen-internal-githook" created="Tue, 19 May 2020 16:10:51 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46721&quot; title=&quot;Step up may cause reads at PIT with holes after yielding&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46721&quot;&gt;&lt;del&gt;SERVER-46721&lt;/del&gt;&lt;/a&gt; Secondary readers should read at the no-overlap time instead of lastApplied&lt;/p&gt;

&lt;p&gt;The no-overlap time, ReadSource::kNoOverlap, is the minimum of replication&apos;s lastApplied timestamp&lt;br/&gt;
and WiredTiger&apos;s all_durable time. This time is independent of replication state and ensures&lt;br/&gt;
queries do not see oplog holes after state transitions from secondary to primary.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 25c694f365db0f07a445bd17b6cd5cbf32f5f2f9)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5ddf9db5635e4af2d1295bd2f1007e86d517c6c2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5ddf9db5635e4af2d1295bd2f1007e86d517c6c2&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3081616" author="louis.williams" created="Tue, 12 May 2020 18:34:05 +0000"  >&lt;p&gt;I am declining the 4.0 backport. We have not observed any build failures on the 4.0 branch. In addition, it does not have the kNoOverlap ReadSource code on which this patch depends. Without having observed any problems, it seems very risky to attempt to implement new behavior and be confident in its correctness on a relatively stable version.&lt;/p&gt;</comment>
                            <comment id="3081547" author="xgen-internal-githook" created="Tue, 12 May 2020 18:03:55 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46721&quot; title=&quot;Step up may cause reads at PIT with holes after yielding&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46721&quot;&gt;&lt;del&gt;SERVER-46721&lt;/del&gt;&lt;/a&gt; Secondary readers should read at the no-overlap time instead of lastApplied&lt;/p&gt;

&lt;p&gt;The no-overlap time, ReadSource::kNoOverlap, is the minimum of replication&apos;s lastApplied timestamp&lt;br/&gt;
and WiredTiger&apos;s all_durable time. This time is independent of replication state and ensures&lt;br/&gt;
queries do not see oplog holes after state transitions from secondary to primary.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/25c694f365db0f07a445bd17b6cd5cbf32f5f2f9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/25c694f365db0f07a445bd17b6cd5cbf32f5f2f9&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="994549">SERVER-44529</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1416196">SERVER-49781</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1368137">SERVER-48518</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1289074">SERVER-47084</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1365768">SERVER-48475</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>5.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_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="18953"><![CDATA[v4.4]]></customfieldvalue>
    <customfieldvalue key="16775"><![CDATA[v4.2]]></customfieldvalue>
    <customfieldvalue key="15640"><![CDATA[v4.0]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000pGRCVQA4]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 23 Mar 2020 16:32:45 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 26 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_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 26 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>geert.bosch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hx554f:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr5f0n:</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="3632">Execution Team 2020-03-23</customfieldvalue>
    <customfieldvalue id="3633">Execution Team 2020-04-06</customfieldvalue>
    <customfieldvalue id="3635">Execution Team 2020-05-04</customfieldvalue>
    <customfieldvalue id="3876">Execution Team 2020-05-18</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|hx4rdr:</customfieldvalue>

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