<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:53:01 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-61666] Tenant migration fails to fetch all txn oplog entries for a txn with commit opTime equal to startFetchingDonorOpTime</title>
                <link>https://jira.mongodb.org/browse/SERVER-61666</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When getting the start fetch time from a donor during a tenant migration, if the last oplog entry on the donor is for a commit transaction and this transaction spanned multiple oplog entries, the recipient will not fetch the transaction&apos;s previous oplog entries. Currently, if a transaction commits before the start fetch timestamp, we walk its oplog chain to fetch all oplog entries in the transaction. For any transactions that haven&apos;t yet committed, we&apos;ll change the start fetch time to be equal to startOpTime of the transaction to make sure we fetch all oplog entries for any open transactions. However, if a transaction commits at exactly the start fetch op time, we skip fetching its chain entirely. When applying oplog entries, the recipient will attempt to apply the commit transaction entry, but won&apos;t have fetched any previous oplog entries for the transaction and will fail with NoSuchKey, aborting the transaction.&lt;/p&gt;

&lt;p&gt;A repro is attached.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1929797">SERVER-61666</key>
            <summary>Tenant migration fails to fetch all txn oplog entries for a txn with commit opTime equal to startFetchingDonorOpTime</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="janna.golden@mongodb.com">Janna Golden</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Nov 2021 22:40:42 +0000</created>
                <updated>Sun, 29 Oct 2023 21:45:42 +0000</updated>
                            <resolved>Sat, 18 Dec 2021 02:15:52 +0000</resolved>
                                                    <fixVersion>5.3.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="4266781" author="xgen-internal-githook" created="Thu, 23 Dec 2021 23:47:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61666&quot; title=&quot;Tenant migration fails to fetch all txn oplog entries for a txn with commit opTime equal to startFetchingDonorOpTime&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61666&quot;&gt;&lt;del&gt;SERVER-61666&lt;/del&gt;&lt;/a&gt; Exclude migration test from multiversion&lt;br/&gt;
Branch: v5.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/4492e86c8bbff4098c929b613a53f1029e3bfda0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/4492e86c8bbff4098c929b613a53f1029e3bfda0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4258052" author="xgen-internal-githook" created="Sat, 18 Dec 2021 00:38:00 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61666&quot; title=&quot;Tenant migration fails to fetch all txn oplog entries for a txn with commit opTime equal to startFetchingDonorOpTime&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61666&quot;&gt;&lt;del&gt;SERVER-61666&lt;/del&gt;&lt;/a&gt; Fix migration for txns before startApplying&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/d886f5d13232ab479dc73f24f5c80f2422326f3e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/d886f5d13232ab479dc73f24f5c80f2422326f3e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4257479" author="jesse" created="Fri, 17 Dec 2021 19:24:12 +0000"  >&lt;p&gt;Previous attempt was reverted because I forgot to add the new test to backports_required_for_multiversion_tests.yml.&lt;/p&gt;</comment>
                            <comment id="4251914" author="xgen-internal-githook" created="Wed, 15 Dec 2021 21:07:33 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61666&quot; title=&quot;Tenant migration fails to fetch all txn oplog entries for a txn with commit opTime equal to startFetchingDonorOpTime&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61666&quot;&gt;&lt;del&gt;SERVER-61666&lt;/del&gt;&lt;/a&gt; Fix migration for txns before startApplying&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit ea6a59377c01ed48157557aaaae0bd8191b7fa4e.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/57db2b83401812f2899a4c02bd896e1c8b6ab046&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/57db2b83401812f2899a4c02bd896e1c8b6ab046&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4233017" author="xgen-internal-githook" created="Mon, 6 Dec 2021 18:50:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61666&quot; title=&quot;Tenant migration fails to fetch all txn oplog entries for a txn with commit opTime equal to startFetchingDonorOpTime&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61666&quot;&gt;&lt;del&gt;SERVER-61666&lt;/del&gt;&lt;/a&gt; Fix migration for txns before startApplying&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ea6a59377c01ed48157557aaaae0bd8191b7fa4e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ea6a59377c01ed48157557aaaae0bd8191b7fa4e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4220681" author="esha.maharishi@10gen.com" created="Tue, 30 Nov 2021 13:58:54 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jesse&quot; class=&quot;user-hover&quot; rel=&quot;jesse&quot;&gt;jesse&lt;/a&gt; I believe we said if the fix is involved, merge would not have this problem, and it only causes a tenant migration to abort (does not cause data corruption), we could do a quick fix to prevent the BF. However, I&apos;m not sure how we could do a quick fix, since the issue can happen in any test in tenant_migration_multi_stmt_txn_jscore_passthrough. Therefore, I think we need to implement an actual fix.&lt;/p&gt;</comment>
                            <comment id="4214874" author="jesse" created="Mon, 29 Nov 2021 16:04:12 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=suganthi.mani&quot; class=&quot;user-hover&quot; rel=&quot;suganthi.mani&quot;&gt;suganthi.mani&lt;/a&gt; could you please attach your repro for initial sync? It would be useful to test that we don&apos;t break initial sync while fixing tenant migrations.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=esha.maharishi&quot; class=&quot;user-hover&quot; rel=&quot;esha.maharishi&quot;&gt;esha.maharishi&lt;/a&gt; can you please remind me what we decided about this ticket? We considered waiting to see if PM-2353 would fix it without effort, but I think we decided we must fix this now, because .... ?&lt;/p&gt;</comment>
                            <comment id="4214768" author="suganthi.mani" created="Mon, 29 Nov 2021 15:42:43 +0000"  >&lt;p&gt;Just adding more insights on it for the future reference, we use the &lt;a href=&quot;https://github.com/10gen/mongo/blob/09c682abb6cab352b1751f1f9b083a9fedaae1ee/src/mongo/db/repl/tenant_oplog_applier.cpp#L911-L914&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;same&lt;/a&gt;&#160;logic even for initial sync to calculate the begin(start) fetching and begin(start) applying timestamp. So, this should be a problem even for the initial sync. I wrote a quick repro simulating the scenario mentioned here for the initial sync, but initial sync didn&apos;t hit the problem. Looking closely into the initial sync code revealed that &lt;a href=&quot;https://github.com/10gen/mongo/blob/09c682abb6cab352b1751f1f9b083a9fedaae1ee/src/mongo/db/repl/oplog_applier_impl.cpp#L630-L634&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this&lt;/a&gt; piece of check prevented the initial code from hitting the &lt;tt&gt;NoSuchKey&lt;/tt&gt; error issue.&lt;/p&gt;

&lt;p&gt;The rule for both initial sync and tenant migration is that we should start replaying oplog entries from Timestamp &amp;gt; begin(start) applying Timestamp.&lt;/p&gt;

&lt;p&gt;In the initial sync, we &lt;a href=&quot;https://github.com/10gen/mongo/blob/09c682abb6cab352b1751f1f9b083a9fedaae1ee/src/mongo/db/repl/oplog_applier_impl.cpp#L672-L682&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;expand&lt;/a&gt;&#160;the unprepared commit transaction oplog entries after the apply timestamp &lt;a href=&quot;https://github.com/10gen/mongo/blob/09c682abb6cab352b1751f1f9b083a9fedaae1ee/src/mongo/db/repl/oplog_applier_impl.cpp#L630-L634&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;check&lt;/a&gt;, by the oplog applier. But, in the tenant migration, the apply timestamp &lt;a href=&quot;https://github.com/10gen/mongo/blob/09c682abb6cab352b1751f1f9b083a9fedaae1ee/src/mongo/db/repl/tenant_oplog_applier.cpp#L911-L914&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;check&lt;/a&gt;&#160;is in the tenant oplog applier but the &lt;a href=&quot;https://github.com/10gen/mongo/blob/09c682abb6cab352b1751f1f9b083a9fedaae1ee/src/mongo/db/repl/tenant_oplog_batcher.cpp#L64-L80&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;expansion&lt;/a&gt;&#160;happens way earlier, during the oplog batching stage. And, that&apos;s not correct. (To be noted, we can end up having a&#160; scenario like this&#160;: Txn1 start opTime &amp;lt; startFetchingOpTime &amp;lt; Txn1 (unprepared) commit opTime &amp;lt; startApplyingOpTime and we would hit the same problem). So, I feel,&#160;&lt;b&gt;Tenant oplog batcher should only expand (unprepared commit) oplog entries with opTime&#160; &amp;gt; StartApplyingDonorOpTime.&lt;/b&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">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="347345" name="repro_tenant_migrations_no_such_key.js" size="3084" author="janna.golden@mongodb.com" created="Mon, 22 Nov 2021 20:47:47 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="22676"><![CDATA[v5.2]]></customfieldvalue>
    <customfieldvalue key="22495"><![CDATA[v5.1]]></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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 29 Nov 2021 15:42:43 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>jesse@mongodb.com</customfieldvalue>
            <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>janna.golden@mongodb.com</customfieldvalue>
            <customfieldvalue>suganthi.mani@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0b3un:</customfieldvalue>

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

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