<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:02:22 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-65295] Handle direct CRUD ops to shards as part of a txn introducing orphan documents</title>
                <link>https://jira.mongodb.org/browse/SERVER-65295</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The code introduced in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-62581&quot; title=&quot;Handle direct inserts to shards introducing orphan documents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-62581&quot;&gt;&lt;del&gt;SERVER-62581&lt;/del&gt;&lt;/a&gt; was taking care of direct inserts to shards but we forgot to cover the case in which those inserts are part of a transaction. It looks like under that scenario we take a different insert path&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=antonio.fuschetto%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;antonio.fuschetto@mongodb.com&quot;&gt;antonio.fuschetto@mongodb.com&lt;/a&gt;&#160; discovered that the problem is not just for TXN doing inserts but for TXN doing any op BUT always directly against the shard, without going through the mongos).&lt;/p&gt;</description>
                <environment></environment>
        <key id="2018234">SERVER-65295</key>
            <summary>Handle direct CRUD ops to shards as part of a txn introducing orphan documents</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="antonio.fuschetto@mongodb.com">Antonio Fuschetto</assignee>
                                    <reporter username="sergi.mateo-bellido@mongodb.com">Sergi Mateo Bellido</reporter>
                        <labels>
                    </labels>
                <created>Wed, 6 Apr 2022 15:21:34 +0000</created>
                <updated>Sun, 29 Oct 2023 21:39:56 +0000</updated>
                            <resolved>Tue, 17 May 2022 07:03:52 +0000</resolved>
                                                    <fixVersion>6.0.0-rc6</fixVersion>
                    <fixVersion>6.1.0-rc0</fixVersion>
                                    <component>Replication</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="4505955" author="josef.ahmad" created="Tue, 26 Apr 2022 10:04:01 +0000"  >&lt;p&gt;The &lt;a href=&quot;https://github.com/mongodb/mongo/blob/847ed004af65831cf0592a96d8bf5b022a46cafd/src/mongo/db/exec/batched_delete_stage.h&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;batched delete&lt;/a&gt; query exec stage also depends on &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-65858&quot; title=&quot;Mark the applyOps entries when the operations involves orphaned documents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-65858&quot;&gt;&lt;del&gt;SERVER-65858&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-65859&quot; title=&quot;Enable filtering of change steam events for individual statements of transactions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-65859&quot;&gt;&lt;del&gt;SERVER-65859&lt;/del&gt;&lt;/a&gt; to avoid emitting change stream events for orphaned documents, because it groups deletes into applyOps statements much like multi-doc transactions (see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-63047&quot; title=&quot;Make delete batches fully transactional&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-63047&quot;&gt;&lt;del&gt;SERVER-63047&lt;/del&gt;&lt;/a&gt;).&lt;/p&gt;</comment>
                            <comment id="4496363" author="JIRAUSER1259062" created="Thu, 21 Apr 2022 07:48:52 +0000"  >&lt;h3&gt;&lt;a name=&quot;Problemdescription&quot;&gt;&lt;/a&gt;Problem description&lt;/h3&gt;

&lt;p&gt;As a consequence of PM-2423, direct write operations (performed from a client directly connected to a shard) on orphaned documents are allowed but must not generate events on change streams.&lt;/p&gt;

&lt;p&gt;Multi-document transactions should have the same behavior, but at the moment this use case is bugged as events corresponding to individual statements are notified on change streams.&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;Agreedsolution&quot;&gt;&lt;/a&gt;Agreed solution&lt;/h3&gt;

&lt;p&gt;The logic to skip notifications on changes stream leverages the existing &lt;tt&gt;fromMigrate&lt;/tt&gt; flag of the oplog entry (that is, do not generate events when the flag is set). Unfortunately, the oplog entry corresponding to individual statements of a transaction (&lt;tt&gt;applyOps&lt;/tt&gt; entries) don&apos;t have the &lt;tt&gt;fromMigrate&lt;/tt&gt; flag and the change stream workflow is currently unable to skip related events.&lt;/p&gt;

&lt;p&gt;Following a discussion with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=bernard.gorman%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;bernard.gorman@mongodb.com&quot;&gt;bernard.gorman@mongodb.com&lt;/a&gt;, we have agreed that the Sharding EMEA team will extend the &lt;tt&gt;applyOps&lt;/tt&gt; entry with the &lt;tt&gt;fromMigrate&lt;/tt&gt; flag where appropriate (see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-65858&quot; title=&quot;Mark the applyOps entries when the operations involves orphaned documents&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-65858&quot;&gt;&lt;del&gt;SERVER-65858&lt;/del&gt;&lt;/a&gt;), whereas the Query Execution team will modify the filtering as necessary across change streams to filter out these entries (see &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-65859&quot; title=&quot;Enable filtering of change steam events for individual statements of transactions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-65859&quot;&gt;&lt;del&gt;SERVER-65859&lt;/del&gt;&lt;/a&gt;).&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="2029803">SERVER-65859</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2029801">SERVER-65858</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.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_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, 21 Apr 2022 07:48:52 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 41 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-65858'>SERVER-65858</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-65859'>SERVER-65859</a></s>]]></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>
                            1 year, 41 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>antonio.fuschetto@mongodb.com</customfieldvalue>
            <customfieldvalue>josef.ahmad@mongodb.com</customfieldvalue>
            <customfieldvalue>sergi.mateo-bellido@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0q3vb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i093b8:</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="5818">Sharding EMEA 2022-04-18</customfieldvalue>
    <customfieldvalue id="6073">Sharding EMEA 2022-05-02</customfieldvalue>
    <customfieldvalue id="6074">Sharding EMEA 2022-05-16</customfieldvalue>
    <customfieldvalue id="6075">Sharding EMEA 2022-05-30</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|i0pq0n:</customfieldvalue>

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