<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:02:24 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-65312] findAndModify pre/post image noop oplog entry forged by chunk migration donor should have the same statement id as the CRUD oplog entry it corresponds to</title>
                <link>https://jira.mongodb.org/browse/SERVER-65312</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently,&#160;each findAndModify pre/post image noop oplog entry is assigned a statement id as follows:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;For the case where the side image collection is enabled, the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0954e8a6694258ad4e19af052bf3bb329a8326fb/src/mongo/db/s/session_catalog_migration_source.cpp#L99&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;SessionCatalogMigrationSource&lt;/a&gt;&#160;and the&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/874c87dc4cf7d01c05c6e2fea9ad1a903ba78902/src/mongo/db/pipeline/document_source_find_and_modify_image_lookup.cpp#L219&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;DocumentSoureceFindAndModifyImageLookup&lt;/a&gt;&#160;aggregation stage the statement id of each forged image oplog entry to 0.&lt;/li&gt;
	&lt;li&gt;For the case where the side image collection is not enable, the OpObserverImpl&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/874c87dc4cf7d01c05c6e2fea9ad1a903ba78902/src/mongo/db/op_observer_impl.cpp#L200&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;indirectly sets&lt;/a&gt;&#160;the statement id of each image oplog entry to the statement id of the oplog entry that has the pre/post image.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;(1) leads to issues in the following case. Consider a sharded collection with only one chunk that resides on shard0.&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;The client performs a findAndModify with a pre-image in a retryable-write session S. The findAndModify has a statement id 1.&lt;/li&gt;
	&lt;li&gt;The chunk is moved from shard0 to shard1. During the migration, shard1 receives a forged pre-image noop oplog entry and an update oplog entry for&#160;the findAndModify. The noop oplog entry has statement id 0 and the update oplog entry has statement id 1.&lt;/li&gt;
	&lt;li&gt;The chunk is moved from shard1 back to shard0. During the migration, shard0&#160;receives a forged pre-image noop oplog entry and a noop oplog entry for the update oplog entry for&#160;the findAndModify. shard0 writes the forged pre-image noop oplog entry but not the update noop since &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ddf7d937d4228b16d03935296480c345e4bdd171/src/mongo/db/s/session_catalog_migration_destination.cpp#L260&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;checkStatementExecuted()&lt;/a&gt;&#160;returns false for statement id 0 but returns true for statement id 1. Upon writing the pre-image noop oplog entry, the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ddf7d937d4228b16d03935296480c345e4bdd171/src/mongo/db/s/session_catalog_migration_destination.cpp#L316&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;primary does not update&lt;/a&gt;&#160;the config.transactions entry for S but the secondaries do since &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ddf7d937d4228b16d03935296480c345e4bdd171/src/mongo/db/repl/session_update_tracker.cpp#L211&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&quot;fromMigrate&quot; is true&lt;/a&gt;&#160;and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ddf7d937d4228b16d03935296480c345e4bdd171/src/mongo/db/repl/session_update_tracker.cpp#L215&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&quot;o2&quot; is not null&lt;/a&gt;. As a result,&#160;the config.transactions entry for S on the primary and secondaries has mismatched content.&#160;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Also, if the client performs another write between step 2 and 3, the migration in step 3 can fail &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ddf7d937d4228b16d03935296480c345e4bdd171/src/mongo/db/s/session_catalog_migration_destination.cpp#L102-L106&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this uassert&lt;/a&gt;&#160;if the write is done in the same session as the findAndModify but with a higher txnNumber and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ddf7d937d4228b16d03935296480c345e4bdd171/src/mongo/db/s/session_catalog_migration_destination.cpp#L107-L110&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this uassert&lt;/a&gt;&#160;if the write is done in a new session. The reason is that processSessionOplog()&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/ddf7d937d4228b16d03935296480c345e4bdd171/src/mongo/db/s/session_catalog_migration_destination.cpp#L262&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;doesn&apos;t update &apos;lastResult&apos;&lt;/a&gt;&#160;upon skipping the update noop so it expects the next oplog entry to correspond to the same retryable write as the pre-image that it is still being tracked by &apos;lastResult&apos;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2018706">SERVER-65312</key>
            <summary>findAndModify pre/post image noop oplog entry forged by chunk migration donor should have the same statement id as the CRUD oplog entry it corresponds to</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="cheahuychou.mao@mongodb.com">Cheahuychou Mao</assignee>
                                    <reporter username="cheahuychou.mao@mongodb.com">Cheahuychou Mao</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Apr 2022 18:58:27 +0000</created>
                <updated>Sun, 29 Oct 2023 21:39:54 +0000</updated>
                            <resolved>Thu, 7 Apr 2022 19:22:02 +0000</resolved>
                                                    <fixVersion>6.0.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4465611" author="xgen-internal-githook" created="Thu, 7 Apr 2022 19:17:19 +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-65312&quot; title=&quot;findAndModify pre/post image noop oplog entry forged by chunk migration donor should have the same statement id as the CRUD oplog entry it corresponds to&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-65312&quot;&gt;&lt;del&gt;SERVER-65312&lt;/del&gt;&lt;/a&gt; findAndModify pre/post image noop oplog entry should have the same statement id as the CRUD oplog entry it corresponds to&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/862b9cc96322329f2c13388a6e8afd5c5482b3e9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/862b9cc96322329f2c13388a6e8afd5c5482b3e9&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2019681">SERVER-65344</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1989876">SERVER-63976</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, 7 Apr 2022 16:14:51 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 43 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_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, 43 weeks, 6 days ago
                        </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>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|i0q6rz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0967w:</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="5733">Sharding NYC 2022-04-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|i0psxb:</customfieldvalue>

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