<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:37: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-78052] Properly handle conflict between balancer splitting due to zoning and auto-merger</title>
                <link>https://jira.mongodb.org/browse/SERVER-78052</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The auto-merger currently works on a secondary thread executed concurrently with the balancer thread and its behavior can be summarized as follows:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;(1) while the balancer is enabled:
	&lt;ul&gt;
		&lt;li&gt;(2) while there are &amp;lt;collection, shard&amp;gt; with mergeable chunks (mergeability requirements documented in &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-15976&quot; title=&quot;[Server] Document `mergeAllChunksOnShard` command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-15976&quot;&gt;&lt;del&gt;DOCS-15976&lt;/del&gt;&lt;/a&gt;)
		&lt;ul&gt;
			&lt;li&gt;(3) for each &amp;lt;collection, shard&amp;gt; discovered by (2):
			&lt;ul&gt;
				&lt;li&gt;(4) squash together mergeable chunks&lt;/li&gt;
				&lt;li&gt;(5) sleep for 15 seconds&lt;/li&gt;
			&lt;/ul&gt;
			&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;(6) sleep for 1 hour&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;As part of a balancing round, the balancer is taking care of &lt;a href=&quot;https://github.com/mongodb/mongo/blob/46ab5002b1bce2da7fc2a86dc98b8a6fa7fb0f9c/src/mongo/db/s/balancer/balancer.cpp#LL771C67-L771C67&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;splitting chunks according to the configured zones&lt;/a&gt; so that they can then be moved off. Since splitting is an operation that does not imply ownership change, 2 or more split chunks are always mergeable as long as they reside on the same shard at least for the history window (defined in &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-15976&quot; title=&quot;[Server] Document `mergeAllChunksOnShard` command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-15976&quot;&gt;&lt;del&gt;DOCS-15976&lt;/del&gt;&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The conflict between the balancer splitting chunks for zoning and the auto-merger squashing together mergeable chunks had been considered acceptable based on the following ideas:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;The auto-merger may merge chunks belonging to different zones that are currently residing on the same shard&lt;/li&gt;
	&lt;li&gt;But anyway the auto-merger will then &quot;go to sleep&quot; for 1 hour&lt;/li&gt;
	&lt;li&gt;This leaves enough time for the balancer to split again and keep on moving data (avoiding future merges)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;It turns out that - given the extreme slowness of splits in case of several hundred of zones - there is a perfect interleaving leading to the following continuous conflict between the balancer and the auto-merger:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;(A) The balancer starts splitting chunks&lt;/li&gt;
	&lt;li&gt;(B) The auto-merger discovers mergeable chunks due to (2)&lt;/li&gt;
	&lt;li&gt;(C) Due to (4), the auto-merger squashes together chunks that were just split because of (A)&lt;/li&gt;
	&lt;li&gt;(D) The auto-merger sleeps 15 seconds due to (5) while (A) is still running and discovers new chunks due to (2)&lt;/li&gt;
	&lt;li&gt;(E) The balancer finishes (A) but part of the split chunks have been merged back&lt;/li&gt;
	&lt;li&gt;Back to A, repeat&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="2367157">SERVER-78052</key>
            <summary>Properly handle conflict between balancer splitting due to zoning and auto-merger</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="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</assignee>
                                    <reporter username="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Jun 2023 18:59:11 +0000</created>
                <updated>Sun, 29 Oct 2023 21:20:06 +0000</updated>
                            <resolved>Thu, 6 Jul 2023 12:22:03 +0000</resolved>
                                                    <fixVersion>7.1.0-rc0</fixVersion>
                    <fixVersion>7.0.0-rc7</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="5553779" author="xgen-internal-githook" created="Mon, 10 Jul 2023 08:26:57 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Pierlauro Sciarelli&apos;, &apos;email&apos;: &apos;pierlauro.sciarelli@mongodb.com&apos;, &apos;username&apos;: &apos;pierlauro&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-78052&quot; title=&quot;Properly handle conflict between balancer splitting due to zoning and auto-merger&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-78052&quot;&gt;&lt;del&gt;SERVER-78052&lt;/del&gt;&lt;/a&gt; + &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-78767&quot; title=&quot;Replace std::ranges::sample usage with std::sample for C++17 compliance&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-78767&quot;&gt;&lt;del&gt;SERVER-78767&lt;/del&gt;&lt;/a&gt; Adapt `commitMergeAllChunksOnShard` to take into account zones&lt;br/&gt;
Branch: v7.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/9eee01c3bd439752e5c3c7d6164dd605cd6a71d8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/9eee01c3bd439752e5c3c7d6164dd605cd6a71d8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5546934" author="xgen-internal-githook" created="Thu, 6 Jul 2023 12:17:51 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Pierlauro Sciarelli&apos;, &apos;email&apos;: &apos;pierlauro.sciarelli@mongodb.com&apos;, &apos;username&apos;: &apos;pierlauro&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-78052&quot; title=&quot;Properly handle conflict between balancer splitting due to zoning and auto-merger&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-78052&quot;&gt;&lt;del&gt;SERVER-78052&lt;/del&gt;&lt;/a&gt; Adapt `commitMergeAllChunksOnShard` to take into account zones&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c1faace9f55cc80a8d70703fe5b36d15c0082846&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c1faace9f55cc80a8d70703fe5b36d15c0082846&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>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                                                <inwardlinks description="is caused by">
                                        <issuelink>
            <issuekey id="2288602">SERVER-74872</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.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_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25133"><![CDATA[Sharding EMEA]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25578"><![CDATA[v7.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>Fri, 23 Jun 2023 17:33:38 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        30 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>
                            30 weeks, 2 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>pierlauro.sciarelli@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2doqf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1vwcg:</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_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="7189">Sharding EMEA 2023-06-26</customfieldvalue>
    <customfieldvalue id="7190">Sharding EMEA 2023-07-10</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|i2davr:</customfieldvalue>

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