<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:17:35 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-48600] RefineCollectionShardKey does not check for transaction write concern errors</title>
                <link>https://jira.mongodb.org/browse/SERVER-48600</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;It checks for top level errors &lt;a href=&quot;https://github.com/mongodb/mongo/blob/25f611b9097228c7b057c11bd1e2b9ee3d492e66/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp#L238&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt; but never checks for write concern errors. Thus the command can succeed and then roll back.&lt;/p&gt;

&lt;p&gt;Here is an &lt;a href=&quot;https://github.com/mongodb/mongo/blob/935fce45d2074ad9bc68fb9c5b05ed73e5fdc186/src/mongo/db/index_builds_coordinator_mongod.cpp#L490-L494&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;example&lt;/a&gt; of checking for both types of errors.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1372554">SERVER-48600</key>
            <summary>RefineCollectionShardKey does not check for transaction write concern errors</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="jack.mulrow@mongodb.com">Jack Mulrow</assignee>
                                    <reporter username="judah.schvimer@mongodb.com">Judah Schvimer</reporter>
                        <labels>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Thu, 4 Jun 2020 19:26:59 +0000</created>
                <updated>Sun, 29 Oct 2023 22:07:24 +0000</updated>
                            <resolved>Mon, 24 Aug 2020 14:06:16 +0000</resolved>
                                                    <fixVersion>4.7.0</fixVersion>
                    <fixVersion>4.4.2</fixVersion>
                                    <component>Replication</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3399994" author="xgen-internal-githook" created="Thu, 17 Sep 2020 21:11:51 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jack Mulrow&apos;, &apos;email&apos;: &apos;jack.mulrow@mongodb.com&apos;, &apos;username&apos;: &apos;jsmulrow&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48600&quot; title=&quot;RefineCollectionShardKey does not check for transaction write concern errors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48600&quot;&gt;&lt;del&gt;SERVER-48600&lt;/del&gt;&lt;/a&gt; refineCollectionShardKey internal transaction should check for write concern errors&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 574976df29afa984cae7e28c5772e71bb0906ec9)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/1e14a0f43e32090b5c22b6805ef6ed42d0f9dc20&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/1e14a0f43e32090b5c22b6805ef6ed42d0f9dc20&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3352654" author="xgen-internal-githook" created="Fri, 21 Aug 2020 17:24:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jack Mulrow&apos;, &apos;email&apos;: &apos;jack.mulrow@mongodb.com&apos;, &apos;username&apos;: &apos;jsmulrow&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48600&quot; title=&quot;RefineCollectionShardKey does not check for transaction write concern errors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48600&quot;&gt;&lt;del&gt;SERVER-48600&lt;/del&gt;&lt;/a&gt; refineCollectionShardKey internal transaction should check for write concern errors&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/574976df29afa984cae7e28c5772e71bb0906ec9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/574976df29afa984cae7e28c5772e71bb0906ec9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3191278" author="jack.mulrow" created="Thu, 4 Jun 2020 21:23:00 +0000"  >&lt;p&gt;Actually, the internal transaction runs on a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/41b01cdece/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp#L597&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;different operation context&lt;/a&gt; from a different client than the one servicing the &lt;tt&gt;_configsvrRefineCollectionShardKey&lt;/tt&gt; command, so the writes from the transaction won&apos;t be considered when &lt;a href=&quot;https://github.com/mongodb/mongo/blob/41b01cdece/src/mongo/db/service_entry_point_mongod.cpp#L113&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;waitForWriteConcern() checks if the command&apos;s last op increased&lt;/a&gt; when deciding whether to wait for write concern after the command executes.&lt;/p&gt;

&lt;p&gt;This isn&apos;t a problem because after the transaction completes, the command&apos;s original operation context is used &lt;a href=&quot;https://github.com/mongodb/mongo/blob/41b01cdece/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp#L696&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;to write to the config.changelog collection&lt;/a&gt;, which&#160;&lt;b&gt;will&lt;/b&gt; advance the client&apos;s last op and trigger waiting for majority write concern of the logging write, which should be greater than the op time of the transaction. This is pretty fragile, so in addition to checking for write concern where the ticket description linked, we may want to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/41b01cdece6f5db6f1a3e85f751b648e5bc0e2da/src/mongo/db/repl/repl_client_info.h#L54&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;set the last op on the command&apos;s client&lt;/a&gt; to the last op from the client used for the internal transaction after it commits.&lt;/p&gt;</comment>
                            <comment id="3191131" author="jack.mulrow" created="Thu, 4 Jun 2020 20:15:01 +0000"  >&lt;p&gt;Mongos sends &lt;tt&gt;_configsvrRefineCollectionShardKey&lt;/tt&gt;&#160;to the config server &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1722c72dde1ae8fa6559af6bc431d075324bd91b/src/mongo/s/commands/cluster_refine_collection_shard_key_cmd.cpp#L75-L76&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;with majority write concern&lt;/a&gt;, so even though that command doesn&apos;t check for a write concern error when committing the refine shard key transaction, I don&apos;t think a refine can succeed if there was a write concern error because waiting for write concern after the command finishes executing should fail.&lt;/p&gt;

&lt;p&gt;It&apos;s probably still worth fixing this though since the config server will &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1722c72dde1ae8fa6559af6bc431d075324bd91b/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp#L702-L705&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;trigger routing table refreshes on each shard with a chunk for the refined namespace&lt;/a&gt; after committing the internal transaction, which is wasted work if the transaction does roll back.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1368563">SERVER-48527</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>4.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="18953"><![CDATA[v4.4]]></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, 4 Jun 2020 20:15:01 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 20 weeks, 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_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>
                            3 years, 20 weeks, 6 days ago
                        </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>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>jack.mulrow@mongodb.com</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxoju7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxdf9z:</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="4251">Sharding 2020-09-07</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|hxo63j:</customfieldvalue>

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