<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:00:17 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-64415] Make MigrationChunkClonerSourceLegacy not add pre/post image opTime to the session migration queue</title>
                <link>https://jira.mongodb.org/browse/SERVER-64415</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;For a retryable findAndModify statement that executes during a chunk migration, retryability is handled as follows.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;If the findAndModify is executed with enableFindAndModifyImageCollection=false, prior to&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5a3ec65dd434f7700ba2f2b173c35a7c4b022437/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp#L567-L568&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;adding the opTime for the write to the transfer mods session migration queue&lt;/a&gt;, the MigrationChunkClonerSourceLegacy explicitly&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5a3ec65dd434f7700ba2f2b173c35a7c4b022437/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp#L565-L566&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;adds the pre/post image opTime to the queue&lt;/a&gt;. This enables the&#160;_&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5a3ec65dd434f7700ba2f2b173c35a7c4b022437/src/mongo/db/s/session_catalog_migration_source.cpp#L451&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;fetchNextNewWriteOplog()&lt;/a&gt; to return the pre/post image oplog entry immediately before the oplog entry for the write without an additional pre/post image oplog fetching logic.&lt;/li&gt;
	&lt;li&gt;If the findAndModify is executed with&#160;enableFindAndModifyImageCollection=true, _fetchNextNewWriteOplog()&#160;is responsible for forging a pre/post image oplog entry upon seeing the&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5a3ec65dd434f7700ba2f2b173c35a7c4b022437/src/mongo/db/s/session_catalog_migration_source.cpp#L495-L508&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;oplog entry for the write (contains the &quot;needsRetryImage&quot; field)&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;For a retryable findAndModify statement that executes prior to a chunk migration, retryablity is handled quite differently in that _&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5a3ec65dd434f7700ba2f2b173c35a7c4b022437/src/mongo/db/s/session_catalog_migration_source.cpp#L431&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;fetchNextOplogFromSessionCatalog()&lt;/a&gt;&#160;is responsible for&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5a3ec65dd434f7700ba2f2b173c35a7c4b022437/src/mongo/db/s/session_catalog_migration_source.cpp#L397&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;both fetching and forging the pre/post image oplog entry&lt;/a&gt;&#160;for the write.&lt;/p&gt;

&lt;p&gt;While this setup in _fetchNextNewWriteOplog() works for a regular retryable findAndModify, it will not work for a retryable findAndModify executed inside an internal transaction.&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/46268920bb349c9e7089c2d3d7ac98ebe052dddd/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp#L164&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Upon prepare or unprepared commit&lt;/a&gt;, the MigrationChunkClonerSourceLegacy could add the pre/post image opTime that it sees&#160;to session migration before &lt;a href=&quot;https://github.com/mongodb/mongo/blob/5a3ec65dd434f7700ba2f2b173c35a7c4b022437/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp#L219-L221&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;adding the prepare or commit opTime&lt;/a&gt;&#160;to queue, however there is not a way for way to specify which statement the pre/post image opTime corresponds to. Since the&#160;SessionCatalogMigrationSource needs to traverse the transaction oplog chain anyway (in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-63494&quot; title=&quot;Transfer history for retryable transactions with more than one oplog entry across migrations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-63494&quot;&gt;&lt;del&gt;SERVER-63494&lt;/del&gt;&lt;/a&gt;), it is simpler for it to fetch the pre/post image oplog entry in&#160;_fetchNextNewWriteOplog() just like it does in&#160;_fetchNextOplogFromSessionCatalog(). Therefore, to avoid having separate logic for handling retryable findAndModify that executes inside and outside a transaction, we should do the following:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Make the MigrationChunkClonerSourceLegacy not add pre/post image opTime to the session migration queue&lt;/li&gt;
	&lt;li&gt;Make _fetchNextNewWriteOplog() use&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5a3ec65dd434f7700ba2f2b173c35a7c4b022437/src/mongo/db/s/session_catalog_migration_source.cpp#L102-L132&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;fetchPrePostImageOplog()&lt;/a&gt;&#160;to fetch or forge pre/post image oplog entry for each new write oplog entry&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5a3ec65dd434f7700ba2f2b173c35a7c4b022437/src/mongo/db/s/session_catalog_migration_source.cpp#L484&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;&#160;(i.e. remove&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/5a3ec65dd434f7700ba2f2b173c35a7c4b022437/src/mongo/db/s/session_catalog_migration_source.cpp#L496-L508&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this duplicated block&lt;/a&gt;&#160;of code), just like what _fetchNextOplogFromSessionCatalog() does.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="1998733">SERVER-64415</key>
            <summary>Make MigrationChunkClonerSourceLegacy not add pre/post image opTime to the session migration queue</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="cheahuychou.mao@mongodb.com">Cheahuychou Mao</assignee>
                                    <reporter username="cheahuychou.mao@mongodb.com">Cheahuychou Mao</reporter>
                        <labels>
                    </labels>
                <created>Thu, 10 Mar 2022 17:00:47 +0000</created>
                <updated>Sun, 29 Oct 2023 21:41:15 +0000</updated>
                            <resolved>Wed, 16 Mar 2022 20:20:46 +0000</resolved>
                                                    <fixVersion>5.3.0-rc4</fixVersion>
                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4416773" author="xgen-internal-githook" created="Wed, 16 Mar 2022 20:04:34 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Cheahuychou Mao&apos;, &apos;email&apos;: &apos;mao.cheahuychou@gmail.com&apos;, &apos;username&apos;: &apos;cheahuychou&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-64415&quot; title=&quot;Make MigrationChunkClonerSourceLegacy not add pre/post image opTime to the session migration queue&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-64415&quot;&gt;&lt;del&gt;SERVER-64415&lt;/del&gt;&lt;/a&gt; Make MigrationChunkClonerSourceLegacy not add pre/post image opTime to the session migration queue&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/6da8828226321ef96eb05c79f3899b759844e02b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/6da8828226321ef96eb05c79f3899b759844e02b&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="1980422">SERVER-63494</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_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 10 Mar 2022 17:11:32 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 47 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-2210</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>
                            1 year, 47 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>cheahuychou.mao@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0mrmn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i05szg:</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_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="5731">Sharding NYC 2022-03-21</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|i0mdrz:</customfieldvalue>

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