<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:11: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-46373] Allow an aggregation sub-operation on a shard to target itself when running in a transaction</title>
                <link>https://jira.mongodb.org/browse/SERVER-46373</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Certain aggregation stages involve sub-operations or sub-pipelines, which may involve targetting and reading from sharded collections when running on a shard (e.g. $lookup, $unionWith). Supporting such stages in a transaction would cause a deadlock on the session mutex if the sub-operation targets the same node its running on, similar to what is described in &lt;a href=&quot;https://github.com/mongodb/mongo/commit/d40d24abc025690150ccf8009ba1facb9ed1c6b2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;SERVER-33683&lt;/a&gt;. Note that &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33683&quot; title=&quot;Allow aggregation $mergeCursors stage to run inside a transaction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33683&quot;&gt;&lt;del&gt;SERVER-33683&lt;/del&gt;&lt;/a&gt; allows a $mergeCursors to run on a shard in a txn, but does not support the case when a stage starts its own sub-operation.&lt;/p&gt;

&lt;p&gt;For this ticket, one possible solution that was discussed would be to use the resource yielder that was built in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33683&quot; title=&quot;Allow aggregation $mergeCursors stage to run inside a transaction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33683&quot;&gt;&lt;del&gt;SERVER-33683&lt;/del&gt;&lt;/a&gt; within the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/s/multi_statement_transaction_requests_sender.h&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;MultiStatementTransactionRequestsSender&lt;/a&gt; if one of the remote shards involved happens to be itself. &lt;/p&gt;</description>
                <environment></environment>
        <key id="1182192">SERVER-46373</key>
            <summary>Allow an aggregation sub-operation on a shard to target itself when running in a transaction</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-optimization">Backlog - Query Optimization</assignee>
                                    <reporter username="nicholas.zolnierz@mongodb.com">Nicholas Zolnierz</reporter>
                        <labels>
                            <label>pm3229-m1</label>
                    </labels>
                <created>Mon, 24 Feb 2020 20:01:34 +0000</created>
                <updated>Tue, 2 Jan 2024 16:24:08 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="5878021" author="JIRAUSER1257318" created="Tue, 14 Nov 2023 09:51:42 +0000"  >&lt;p&gt;One thing to note is that the original issue described in this ticket (a shard deadlocking when remote-targeting itself) has been almost solved by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-63495&quot; title=&quot;Support targeting remote shards from transaction API on mongod for subset of commands&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-63495&quot;&gt;&lt;del&gt;SERVER-63495&lt;/del&gt;&lt;/a&gt;, that made MultiStatementTransactionRequestsSender use a ResourceYielder when sending remote commands. I believe we only need to tweak it so that when executing on a shard, it uses a TransactionParticipantResourceYielder (which also stashes the participant&apos;s transaction resources) instead of a TransactionRouterResourceYielder (which only yields the checked out session).&lt;/p&gt;

&lt;p&gt;However, the problem that remains is how to make a shard be able target other shards which may not yet be a participant of the transactions. The shard must make sure to start the transaction on the new participant passing it the proper transaction metadata (readConcern, placementConflictConcern). Also, the shard must report back the new additional participant to the TransactionRouter (on mongos, typically). This work is expected to be done by PM-2844.&lt;/p&gt;</comment>
                            <comment id="5613466" author="david.storch" created="Fri, 4 Aug 2023 14:25:45 +0000"  >&lt;p&gt;This is something that we believe we will need to do as part of &quot;remove query reliance on db primary&quot;. As part of this project, we will create situations where the merging pipeline has a $lookup that needs to target a shard which is already participating in the transaction.&lt;/p&gt;</comment>
                            <comment id="3013282" author="charlie.swanson" created="Mon, 30 Mar 2020 17:14:16 +0000"  >&lt;p&gt;Marking this as depending on&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46378&quot; title=&quot;Support continuing a transaction started by mongos (or different shard) on a shard&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46378&quot;&gt;&lt;del&gt;SERVER-46378&lt;/del&gt;&lt;/a&gt; because that ticket is believed to be much larger and both are dependencies for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45542&quot; title=&quot;Support and test $unionWith aggregation stage within a transaction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45542&quot;&gt;SERVER-45542&lt;/a&gt;. The query team can pick this one up if/when&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46378&quot; title=&quot;Support continuing a transaction started by mongos (or different shard) on a shard&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46378&quot;&gt;&lt;del&gt;SERVER-46378&lt;/del&gt;&lt;/a&gt; is resolved so we can unblock $unionWith in a transaction.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="1182358">SERVER-46378</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="1347526">SERVER-48122</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1088748">SERVER-45542</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2535111">SERVER-84470</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="676935">SERVER-39162</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25126"><![CDATA[Query Optimization]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 30 Mar 2020 17:14:16 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 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-46378'>SERVER-46378</a></s>, <a href='https://jira.mongodb.org/browse/PM-2844'>PM-2844</a>]]></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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-3229</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>max.hirschhorn@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-optimization</customfieldvalue>
            <customfieldvalue>charlie.swanson@mongodb.com</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>jordi.serra-torrens@mongodb.com</customfieldvalue>
            <customfieldvalue>nicholas.zolnierz@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hwuh4n:</customfieldvalue>

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

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