<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:01:20 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-42751] Take CSRLock when observing transaction commit for migration</title>
                <link>https://jira.mongodb.org/browse/SERVER-42751</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;h2&gt;&lt;a name=&quot;Background&quot;&gt;&lt;/a&gt;Background&lt;/h2&gt;
&lt;p&gt;When a transaction commits, it checks collections involved and adds to migration document queues if necessary. To do this, we check if a &lt;tt&gt;MigrationSourceManager&lt;/tt&gt; variable exists on the &lt;tt&gt;CollectionShardingRuntime&lt;/tt&gt;. Due to the fact that transactions stash locks, we skip the collection lock check assertion &lt;a href=&quot;https://github.com/mongodb/mongo/blob/7d8dbd3bb7900e470125158d81c8536032a7b5c8/src/mongo/db/s/collection_sharding_state.cpp#L146-L159&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;via the get_UNSAFE method&lt;/a&gt;. Skipping the collection lock assertion is fine, since we guarantee at storage commit time that collection locks are held. However, we &lt;a href=&quot;https://github.com/mongodb/mongo/blob/7d8dbd3bb7900e470125158d81c8536032a7b5c8/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp#L165-L166&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;also skip acquisition of the CSRLock&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Issue&quot;&gt;&lt;/a&gt;Issue&lt;/h2&gt;
&lt;p&gt;Since we don&apos;t take the CSRLock, we currently have the pointer to the &lt;tt&gt;MigrationSourceManager&lt;/tt&gt; and chunk cloner without any concurrency guarantees. This means that the pointer to the &lt;tt&gt;MigrationSourceManager&lt;/tt&gt; can go out of scope at any time.&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Solution&quot;&gt;&lt;/a&gt;Solution&lt;/h2&gt;
&lt;p&gt;We take the CSRLock in exclusive mode in order to unregister the pointer/memory for the &lt;tt&gt;MigrationSourceManager&lt;/tt&gt;. We can take the CSRLock in read mode during observing transaction commit to guarantee that we don&apos;t remove the pointer while the underlying &lt;tt&gt;MigrationSourceManager&lt;/tt&gt; is in use.&lt;/p&gt;</description>
                <environment></environment>
        <key id="890033">SERVER-42751</key>
            <summary>Take CSRLock when observing transaction commit for migration</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="alex.taskov@mongodb.com">Alexander Taskov</assignee>
                                    <reporter username="blake.oler@mongodb.com">Blake Oler</reporter>
                        <labels>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Fri, 9 Aug 2019 19:38:17 +0000</created>
                <updated>Sun, 29 Oct 2023 22:18:12 +0000</updated>
                            <resolved>Thu, 29 Aug 2019 15:00:20 +0000</resolved>
                                    <version>4.2.0-rc8</version>
                    <version>4.3.1</version>
                                    <fixVersion>4.2.1</fixVersion>
                    <fixVersion>4.3.1</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="2469814" author="xgen-internal-githook" created="Mon, 7 Oct 2019 19:39:02 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;alextaskov&apos;, &apos;email&apos;: &apos;alex.taskov@mongodb.com&apos;, &apos;name&apos;: &apos;Alex Taskov&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42751&quot; title=&quot;Take CSRLock when observing transaction commit for migration&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42751&quot;&gt;&lt;del&gt;SERVER-42751&lt;/del&gt;&lt;/a&gt; Take CSRLock when observing transaction commit for migration&lt;/p&gt;

&lt;p&gt;(cherry picked from commit cd96f9b455f63945b4ea8b772529284d8721284a)&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/6e2a0a863d59213c61128690350ec010cd7a759e&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/6e2a0a863d59213c61128690350ec010cd7a759e&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2436639" author="blake.oler" created="Fri, 27 Sep 2019 15:33:05 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alex.taskov&quot; class=&quot;user-hover&quot; rel=&quot;alex.taskov&quot;&gt;alex.taskov&lt;/a&gt; requesting a backport on this since the BFs come from 4.2&lt;/p&gt;</comment>
                            <comment id="2399773" author="xgen-internal-githook" created="Thu, 29 Aug 2019 14:56:23 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;alex.taskov@mongodb.com&apos;, &apos;name&apos;: &apos;Alex Taskov&apos;, &apos;username&apos;: &apos;alextaskov&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42751&quot; title=&quot;Take CSRLock when observing transaction commit for migration&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42751&quot;&gt;&lt;del&gt;SERVER-42751&lt;/del&gt;&lt;/a&gt; Take CSRLock when observing transaction commit for migration&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/cd96f9b455f63945b4ea8b772529284d8721284a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/cd96f9b455f63945b4ea8b772529284d8721284a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2399128" author="kaloian.manassiev" created="Thu, 29 Aug 2019 10:06:12 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=blake.oler&quot; class=&quot;user-hover&quot; rel=&quot;blake.oler&quot;&gt;blake.oler&lt;/a&gt;, from your description, I understand that it is OK to not check for lock acquisition here, because at transaction commit time, the locks are stashed on the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ffd486c3ff049abc9f8a2c76b3e2b9dea970c19b/src/mongo/db/transaction_participant.cpp#L671&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;txnResourceStash of the TransactionParticipant&lt;/a&gt; associated with the Session on which this transaction runs, but they have not been placed on the Locker of the operation context currently executing.&lt;/p&gt;

&lt;p&gt;This is a very roundabout way of ensuring that and doesn&apos;t allow us to add invariants. Would it be too difficult to ensure that transaction commits unstash their resources so we can throw out these UNSAFE methods?&lt;/p&gt;</comment>
                            <comment id="2398336" author="alex.taskov" created="Wed, 28 Aug 2019 19:42:53 +0000"  >&lt;p&gt;&lt;a href=&quot;https://mongodbcr.appspot.com/483170003/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://mongodbcr.appspot.com/483170003/&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.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_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16775"><![CDATA[v4.2]]></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>Wed, 28 Aug 2019 19:42:53 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 18 weeks, 2 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_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>
                            4 years, 18 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>56.0</customfieldvalue>

                        </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>alex.taskov@mongodb.com</customfieldvalue>
            <customfieldvalue>blake.oler@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hvjywn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hv8uxz:</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="3198">Sharding 2019-09-09</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|hvjl5z:</customfieldvalue>

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