<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:24:23 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-73338] Make aborting transactions on mongos shutdown best effort</title>
                <link>https://jira.mongodb.org/browse/SERVER-73338</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;During mongos shutdown procedure, after waiting for &lt;a href=&quot;https://github.com/mongodb/mongo/blob/f1134e89296bd57a014af29d02aa1cb93ac864d2/src/mongo/s/mongos_main.cpp#L295&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;quiesce period&lt;/a&gt; we attempt to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/f1134e89296bd57a014af29d02aa1cb93ac864d2/src/mongo/s/mongos_main.cpp#L308&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;abort all the outstanding transactions&lt;/a&gt; by sending the abortTransaction to the relevant shards. This logic was added in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39692&quot; title=&quot;Make graceful MongoS shutdown drain all in-progress transactions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39692&quot;&gt;&lt;del&gt;SERVER-39692&lt;/del&gt;&lt;/a&gt; and does not provide strong guarantees, in fact:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/f1134e89296bd57a014af29d02aa1cb93ac864d2/src/mongo/s/mongos_main.cpp#L230&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;After 15 seconds we will just give up&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/f1134e89296bd57a014af29d02aa1cb93ac864d2/src/mongo/s/transaction_router.cpp#L1434&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;If an error occurred during the forwarding of the abortCommand we also give up&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So I would define this as &quot;best effort&quot; approach to abort transactions, but on the other side &lt;a href=&quot;https://github.com/mongodb/mongo/blob/f1134e89296bd57a014af29d02aa1cb93ac864d2/src/mongo/s/transaction_router.cpp#L1423&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;we use &lt;tt&gt;Shard::RetryPolicy::kIdempotent&lt;/tt&gt;&lt;/a&gt;. As a consequence if some shard is unreachable (crashed or already shut down) the mongos will keep retrying sending the abortTransaction command for 15 seconds slowing down the mongos shutdown procedure.&lt;/p&gt;

&lt;p&gt;So practically if we don&apos;t want to hit this 15 seconds delay when shutting down a cluster we must always ensure the mongos is shut down before the shards.&lt;/p&gt;

&lt;p&gt;My proposal is to make this logic truly best effort and use &lt;tt&gt;runFireAndForgetCommand&lt;/tt&gt; to send the abortTransaction command. This will guarantee that if some node is unreachable we won&apos;t delay mongos shutdown.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2244217">SERVER-73338</key>
            <summary>Make aborting transactions on mongos shutdown best effort</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-server-catalog-and-routing">Backlog - Catalog and Routing</assignee>
                                    <reporter username="tommaso.tocci@mongodb.com">Tommaso Tocci</reporter>
                        <labels>
                            <label>oldshardingemea</label>
                            <label>shardingemea-qw</label>
                    </labels>
                <created>Thu, 26 Jan 2023 13:58:03 +0000</created>
                <updated>Thu, 26 Oct 2023 10:17:22 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5142913" author="max.hirschhorn@10gen.com" created="Thu, 26 Jan 2023 15:23:52 +0000"  >&lt;blockquote&gt;
&lt;p&gt;but on the other side we use Shard::RetryPolicy::kIdempotent&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I do see some value for mongos retrying the abortTransaction command and waiting 15 seconds at shutdown in a production server. If a transaction is left idle on the shards then this can lead to 60 seconds (transactionLifetimeLimitSeconds) of unavailability to the documents modified by the transaction. I wonder if because the motivation for this change is around quickly shutting down a sharded cluster used for local / Evergreen testing that we should approach the 15&amp;#45;second deadline similar to what was done in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46952&quot; title=&quot;Create server parameter shutdownTimeoutMillisForSignaledShutdown on mongod&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46952&quot;&gt;&lt;del&gt;SERVER-46952&lt;/del&gt;&lt;/a&gt; / &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40335&quot; title=&quot;Don&amp;#39;t wait for election handoff in ReplSetTest.stopSet()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40335&quot;&gt;&lt;del&gt;SERVER-40335&lt;/del&gt;&lt;/a&gt;. That is, have a server parameter which is set by all sharded clusters spawned for testing to reduce the deadline to something like 100 milliseconds.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2245736">SERVER-73415</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>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.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_23577" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>CAR Impact</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25715"><![CDATA[2 Medium  (users + team) or (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>Thu, 26 Jan 2023 15:23:52 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 1 week, 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_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>dbeng-pm-bot</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 1 week, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-catalog-and-routing</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
            <customfieldvalue>tommaso.tocci@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i1sian:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i18wec:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="6812">Sharding EMEA 2023-02-06</customfieldvalue>
    <customfieldvalue id="6818">Sharding EMEA 2023-04-17</customfieldvalue>
    <customfieldvalue id="7185">Sharding EMEA 2023-05-01</customfieldvalue>
    <customfieldvalue id="7186">Sharding EMEA 2023-05-15</customfieldvalue>
    <customfieldvalue id="7187">Sharding EMEA 2023-05-29</customfieldvalue>
    <customfieldvalue id="7188">Sharding EMEA 2023-06-12</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_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|i1s4fz:</customfieldvalue>

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