<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:05:09 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-66340] Improve distributed transaction commit locking behavior</title>
                <link>https://jira.mongodb.org/browse/SERVER-66340</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In a distributed transaction, when the coordinator &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c6e976d9f67a1b50826784e7a0eda9bfe212dd73/src/mongo/db/s/transaction_coordinator_util.cpp#L330-L432&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;writes its commit decision&lt;/a&gt;, it takes global/db/collection locks to do so while the participant is also still holding the global lock. This can cause issues when combined with operations that take strong global locks, as seen in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-65821&quot; title=&quot;Deadlock during setFCV when there are prepared transactions that have not persisted commit/abort decision&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-65821&quot;&gt;&lt;del&gt;SERVER-65821&lt;/del&gt;&lt;/a&gt;. We should investigate ways to improve this behavior so that we can remove the workaround added in that ticket. One potential idea is to consolidate the participant and coordinator on the coordinating shard, so that they can make progress with a single set of resources.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2043274">SERVER-66340</key>
            <summary>Improve distributed transaction commit locking behavior</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="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="josef.ahmad@mongodb.com">Josef Ahmad</assignee>
                                    <reporter username="gregory.noma@mongodb.com">Gregory Noma</reporter>
                        <labels>
                            <label>car-qw</label>
                    </labels>
                <created>Tue, 10 May 2022 13:38:15 +0000</created>
                <updated>Thu, 14 Dec 2023 10:44:42 +0000</updated>
                            <resolved>Thu, 14 Dec 2023 10:43:10 +0000</resolved>
                                                    <fixVersion>7.3.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>12</watches>
                                                                                                                <comments>
                            <comment id="5949057" author="xgen-internal-githook" created="Wed, 13 Dec 2023 19:47:23 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Josef Ahmad&apos;, &apos;email&apos;: &apos;josef.ahmad@mongodb.com&apos;, &apos;username&apos;: &apos;josefahmad&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-66340&quot; title=&quot;Improve distributed transaction commit locking behavior&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-66340&quot;&gt;&lt;del&gt;SERVER-66340&lt;/del&gt;&lt;/a&gt; Generalise the FeatureCompatibilityVersion lock into a MultiDocumentTransactionsBarrier&lt;/p&gt;

&lt;p&gt;This barrier resolves a class of deadlocks involving an uncommitted transaction in the&lt;br/&gt;
prepared state and a global lock acquisition request in non-intent mode. Without this&lt;br/&gt;
barrier, this would result in a three-way deadlock between (A) a strong global lock&lt;br/&gt;
request which depends on (B) a prepared transaction which holds the global lock in intent&lt;br/&gt;
mode which depends on (C) the transaction coordinator persisting the commit/abort&lt;br/&gt;
decision, which depends on (A), thus establishing a circular dependency.&lt;/p&gt;

&lt;p&gt;The FeatureCompatibilityVersion lock was initially introduced to address this issue&lt;br/&gt;
during FCV upgrades/downgrades, which acquire the global lock in MODE_S. This&lt;br/&gt;
patch generalises this lock into a MultiDocumentTransactionsBarrier to address any&lt;br/&gt;
non-intent global lock acquisitions, including fsyncLock.&lt;br/&gt;
The MultiDocumentTransactionsBarrier transparently drains prepared transactions&lt;br/&gt;
before acquiring the global lock in non-intent mode. It is implicitly acquired as part of a&lt;br/&gt;
global lock acquisition by operations processing transaction statements, and by operations&lt;br/&gt;
acquiring the global lock in non-intent mode. All other global lock requests skip this&lt;br/&gt;
lock. It is acquired in the same mode as the requested global lock mode.&lt;/p&gt;

&lt;p&gt;One (benign) behavioural change is that prepared transactions that commit while a global&lt;br/&gt;
lock request is enqueued will not be able to acknowledge their write concern to the client&lt;br/&gt;
until the global lock is rescinded.&lt;/p&gt;

&lt;p&gt;GitOrigin-RevId: 6517ac7482c0aa6da26af1b530bd5755737d6d1e&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1888cae7b06f7944437661794559470c26672177&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1888cae7b06f7944437661794559470c26672177&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4777592" author="geert.bosch" created="Thu, 25 Aug 2022 19:23:17 +0000"  >&lt;p&gt;I chatted with Max, and we agree that this ticket is not ready for work as written, but rather indicates that there&apos;s some larger rethink/remodel that is necessary to be able to remove the current workaround. I&apos;l put this on the storage execution backlog for now to see if there is a project that we can make this part of.&lt;/p&gt;</comment>
                            <comment id="4776867" author="max.hirschhorn@10gen.com" created="Thu, 25 Aug 2022 15:34:14 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=geert.bosch%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;geert.bosch@mongodb.com&quot;&gt;geert.bosch@mongodb.com&lt;/a&gt;, I&apos;d like to propose we close this ticket without making any changes and leave the new &lt;tt&gt;resourceIdFeatureCompatibilityVersion&lt;/tt&gt; resource as&amp;#45;is. I think attempting to have the TransactionCoordinator and TransactionParticipant share their TxnResources (read: LockManager locks) is a challenging undertaking and isn&apos;t fully sufficient as an alternative for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-65821&quot; title=&quot;Deadlock during setFCV when there are prepared transactions that have not persisted commit/abort decision&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-65821&quot;&gt;&lt;del&gt;SERVER-65821&lt;/del&gt;&lt;/a&gt;. We would also need the WaitForMajorityService to receive the global IS lock from those TxnResources plus probably share with other Clients which the system happens to interact with as well.&lt;/p&gt;

&lt;p&gt;I feel like approaching the TransactionCoordinator differently ties into approaching the threading and Client models differently for the whole server.&lt;/p&gt;

&lt;p&gt;Are you comfortable with leaving things as&amp;#45;is?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2414900">SERVER-79922</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2043276">SERVER-66342</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="2043275">SERVER-66341</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2028940">SERVER-65821</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2043275">SERVER-66341</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26387"><![CDATA[Catalog and Routing]]></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_23577" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>CAR Impact</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25716"><![CDATA[3 High (users + team + external teams)]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 21 Jun 2022 14:06:27 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 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_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>josef.ahmad@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>geert.bosch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>gregory.noma@mongodb.com</customfieldvalue>
            <customfieldvalue>josef.ahmad@mongodb.com</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0uav3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0d7pk:</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_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="7891">CAR Team 2023-12-25</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</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|i0tx0f:</customfieldvalue>

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