<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:21:53 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-29812] RangeDeleter unnecessarily waits for &apos;majority&apos; write concern</title>
                <link>https://jira.mongodb.org/browse/SERVER-29812</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The range deleter waits for replication on two occasions:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;First using the moveChunk operation&apos;s write concern in &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.4.4/src/mongo/db/dbhelpers.cpp#L447&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;Helpers::removeRange&lt;/tt&gt;&lt;/a&gt; which does log the time spent for replication.&lt;/li&gt;
	&lt;li&gt;Second time using a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.4.4/src/mongo/db/range_deleter.cpp#L362&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&apos;majority&apos; write concern&lt;/a&gt;, which does not log at all.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;This second majority wait is completely unnecessary. The migration recipient side can keep going without attempting a majority write until the very end, after all documents have been transferred.&lt;/p&gt;

&lt;p&gt;As part of fixing this bug, we should consider the following:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Before even accepting a migration request, the recipient shard should do a best-effort attempt to check how behind it is from the rest of the replica set (perhaps by doing a majority write with some timeout then) and if that fails, don&apos;t even attempt a migration. This is the counterpart of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-22876&quot; title=&quot;Ensure &amp;#39;majority&amp;#39; writes are possible before entering the migration critical section&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-22876&quot;&gt;&lt;del&gt;SERVER-22876&lt;/del&gt;&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;If the migration was for an empty chunk and we didn&apos;t patch up any indexes, do not do any replication waits at all and enter the READY state immediately.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="397432">SERVER-29812</key>
            <summary>RangeDeleter unnecessarily waits for &apos;majority&apos; write concern</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="kevin.pulo@mongodb.com">Kevin Pulo</assignee>
                                    <reporter username="kaloian.manassiev@mongodb.com">Kaloian Manassiev</reporter>
                        <labels>
                    </labels>
                <created>Fri, 23 Jun 2017 12:05:24 +0000</created>
                <updated>Mon, 30 Oct 2023 23:15:46 +0000</updated>
                            <resolved>Wed, 28 Feb 2018 11:57:21 +0000</resolved>
                                    <version>3.2.14</version>
                    <version>3.4.4</version>
                                    <fixVersion>3.4.14</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>13</watches>
                                                                                                                <comments>
                            <comment id="1818349" author="xgen-internal-githook" created="Wed, 28 Feb 2018 11:55:14 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;kevin.pulo@mongodb.com&apos;, &apos;name&apos;: &apos;Kevin Pulo&apos;, &apos;username&apos;: &apos;devkev&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-29812&quot; title=&quot;RangeDeleter unnecessarily waits for &amp;#39;majority&amp;#39; write concern&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-29812&quot;&gt;&lt;del&gt;SERVER-29812&lt;/del&gt;&lt;/a&gt; RangeDeleter no longer unnecessarily waits for &apos;majority&apos; write concern&lt;br/&gt;
Branch: v3.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ab8a14b2b3d034745f22133a964245b027b2d1e5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ab8a14b2b3d034745f22133a964245b027b2d1e5&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1811472" author="kaloian.manassiev" created="Wed, 21 Feb 2018 14:24:01 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kevin.pulo&quot; class=&quot;user-hover&quot; rel=&quot;kevin.pulo&quot;&gt;kevin.pulo&lt;/a&gt;, I agree with your comments. With the changes we are currently doing to optimize the speed of migrations, I don&apos;t think we need to look into the second part yet. I opened &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-33417&quot; title=&quot;Replace custom majority write catchup with Replication-designed write concern method in the Migration Destination Manager&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-33417&quot;&gt;&lt;del&gt;SERVER-33417&lt;/del&gt;&lt;/a&gt; just to track this idea.&lt;/p&gt;</comment>
                            <comment id="1811218" author="kevin.pulo@10gen.com" created="Wed, 21 Feb 2018 04:57:08 +0000"  >&lt;blockquote&gt;&lt;p&gt;Before even accepting a migration request, the recipient shard should do a best-effort attempt to check how behind it is from the rest of the replica set (perhaps by doing a majority write with some timeout then) and if that fails, don&apos;t even attempt a migration.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This feels like &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-16805&quot; title=&quot;Balancer should not migrate chunks to shards that cannot satisfy w:majority&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-16805&quot;&gt;&lt;del&gt;SERVER-16805&lt;/del&gt;&lt;/a&gt;, and I think would be better off left for that ticket.  Also because that would be a change in master, whereas the main changes here are only in 3.4.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;If the migration was for an empty chunk and we didn&apos;t patch up any indexes, do not do any replication waits at all and enter the READY state immediately.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Since this would be a migration-related change, rather than range deleter related &amp;#8212; and also possibly relevant to master, not just v3.4 &amp;#8212; I think this would be better considered on its own SERVER ticket.  Let me know if you&apos;d still like me to look into this aspect on this ticket.&lt;/p&gt;</comment>
                            <comment id="1726498" author="kaloian.manassiev" created="Wed, 15 Nov 2017 15:51:08 +0000"  >&lt;p&gt;Yes, this is no longer a problem in 3.6, but I would like to have it fixed in 3.4 because it will improve the speed of migrations.&lt;/p&gt;</comment>
                            <comment id="1726423" author="dianna.hohensee" created="Wed, 15 Nov 2017 15:10:24 +0000"  >&lt;p&gt;This ticket relates to the old RangeDeleter, which has since been replaced by a new CollectionRangeDeleter. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kaloian.manassiev&quot; class=&quot;user-hover&quot; rel=&quot;kaloian.manassiev&quot;&gt;kaloian.manassiev&lt;/a&gt;, can we close this, or are you thinking of a v3.4 backport?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="397362">SERVER-29807</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>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</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, 15 Nov 2017 15:10:24 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 50 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-629</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>
                            5 years, 50 weeks 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>dianna.hohensee@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>kevin.pulo@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht9sen:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsoznb:</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="2110">Sharding 2018-02-26</customfieldvalue>
    <customfieldvalue id="2166">Sharding 2018-03-12</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_11861" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>User Summary</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11856"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|ht9eh3:</customfieldvalue>

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