<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:06:33 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-66835] [test-only bug] Compare number of chunks in balancing_based_on_size.js</title>
                <link>https://jira.mongodb.org/browse/SERVER-66835</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Change &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9e4f58aa6bb73cbcd7e3f9f5a6dbcbc5c88b8254/jstests/sharding/balancing_based_on_size.js#L111-L119&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this data size comparison&lt;/a&gt; with a comparison on number of chunks: this is equivalent because that part of the test simply needs to verify that no move has happened due to expected &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9e4f58aa6bb73cbcd7e3f9f5a6dbcbc5c88b8254/jstests/sharding/balancing_based_on_size.js#L94-L105&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;no-op balancing rounds&lt;/a&gt;.&lt;/p&gt;
&lt;h5&gt;&lt;a name=&quot;Longexplanation%28fromabuildfailure%29&quot;&gt;&lt;/a&gt;Long explanation (from a build failure)&lt;/h5&gt;

&lt;p&gt;When a range deletion happens:&lt;br/&gt;
&lt;font color=&quot;#de350b&quot;&gt;1.&lt;/font&gt; The documents in range &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ac297836aede311622e60ee502dda7ac6bb344fc/src/mongo/db/s/range_deletion_util.cpp#L327-L331&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;are deleted&lt;/a&gt;.&lt;br/&gt;
&lt;font color=&quot;#de350b&quot;&gt;2.&lt;/font&gt; The counter of orphans &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ac297836aede311622e60ee502dda7ac6bb344fc/src/mongo/db/s/range_deletion_util.cpp#L332-L333&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;is updated&lt;/a&gt;, triggering also an &lt;a href=&quot;https://github.com/mongodb/mongo/blob/114313e06a03cfc19a502209c525330a29c36be7/src/mongo/db/s/migration_util.cpp#L716&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;update of the orphans counter on the &lt;tt&gt;BalancerStatsRegistry&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Note that points 1-2 are not happening in the same storage transaction, and - even if they would - the update of the in-memory stats registry would still not happen atomically.&lt;/p&gt;

&lt;p&gt;The test uses the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9e4f58aa6bb73cbcd7e3f9f5a6dbcbc5c88b8254/jstests/sharding/balancing_based_on_size.js#L21&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;get stats for balancing command&lt;/a&gt; that - when invoked for a namespace:&lt;br/&gt;
&lt;font color=&quot;#de350b&quot;&gt;A.&lt;/font&gt; &lt;a href=&quot;https://github.com/mongodb/mongo/blob/7a87b42de9fd34123caf6c81ff75835e3b5c8e23/src/mongo/db/s/shardsvr_get_stats_for_balancing_command.cpp#L114&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Retrieves the total data size&lt;/a&gt; for the collection from the storage stats.&lt;br/&gt;
&lt;font color=&quot;#de350b&quot;&gt;B.&lt;/font&gt; &lt;a href=&quot;https://github.com/mongodb/mongo/blob/7a87b42de9fd34123caf6c81ff75835e3b5c8e23/src/mongo/db/s/shardsvr_get_stats_for_balancing_command.cpp#L127&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Retrieves the number of orphans&lt;/a&gt; for the collection from the &lt;tt&gt;BalancerStatsRegistry&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;The test is doing the following:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Wait for the collection to be fully balanced.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/9e4f58aa6bb73cbcd7e3f9f5a6dbcbc5c88b8254/jstests/sharding/balancing_based_on_size.js#L84&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Retrieve the actual collection data size&lt;/a&gt; (dataSize - num orphans) from the most loaded shard.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/9e4f58aa6bb73cbcd7e3f9f5a6dbcbc5c88b8254/jstests/sharding/balancing_based_on_size.js#L94-L105&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Wait for 3 balancing rounds&lt;/a&gt; that must not move any data.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/9e4f58aa6bb73cbcd7e3f9f5a6dbcbc5c88b8254/jstests/sharding/balancing_based_on_size.js#L111&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Retrieve again the actual collection data size&lt;/a&gt; (dataSize - num orphans) from the most loaded shard.&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/9e4f58aa6bb73cbcd7e3f9f5a6dbcbc5c88b8254/jstests/sharding/balancing_based_on_size.js#L117&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Make sure&lt;/a&gt; the actual data size on the most loaded shard didn&apos;t change following the no-op balancing rounds.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;According to the failure, the actual data size on the donor was &lt;b&gt;&lt;tt&gt;6&lt;/tt&gt;&lt;/b&gt; before the no-op rounds and became &lt;b&gt;&lt;tt&gt;7&lt;/tt&gt;&lt;/b&gt; after the no-op rounds. However, no move has happened and the rounds really resulted in no-ops.&lt;/p&gt;

&lt;p&gt;The only viable explanation is that the following flow interleaving happened: &lt;font color=&quot;#de350b&quot;&gt;&lt;b&gt;1 - A - 2 - B&lt;/b&gt;&lt;/font&gt;. Basically the balancer stats registry retrieved the data size after an orphaned document was deleted but before the number of orphans was updated. This resulted in an off-by-one.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2056767">SERVER-66835</key>
            <summary>[test-only bug] Compare number of chunks in balancing_based_on_size.js</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>Fri, 27 May 2022 15:19:04 +0000</created>
                <updated>Sun, 29 Oct 2023 21:37:37 +0000</updated>
                            <resolved>Wed, 1 Jun 2022 19:31:33 +0000</resolved>
                                                    <fixVersion>6.0.3</fixVersion>
                    <fixVersion>6.1.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4903354" author="xgen-internal-githook" created="Fri, 14 Oct 2022 13:35:06 +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-66835&quot; title=&quot;[test-only bug] Compare number of chunks in balancing_based_on_size.js&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-66835&quot;&gt;&lt;del&gt;SERVER-66835&lt;/del&gt;&lt;/a&gt; Compare number of chunks in balancing_based_on_size.js&lt;br/&gt;
Branch: v6.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/dc846d69a62b3f6ef7218df06dd5f7a15d0e3264&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/dc846d69a62b3f6ef7218df06dd5f7a15d0e3264&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4587522" author="xgen-internal-githook" created="Wed, 1 Jun 2022 17:41:24 +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-66835&quot; title=&quot;[test-only bug] Compare number of chunks in balancing_based_on_size.js&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-66835&quot;&gt;&lt;del&gt;SERVER-66835&lt;/del&gt;&lt;/a&gt; Compare number of chunks in balancing_based_on_size.js&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/0f1053354a132f8259e740f927dc9e67a2c64cea&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/0f1053354a132f8259e740f927dc9e67a2c64cea&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>2.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="23470"><![CDATA[v6.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, 1 Jun 2022 12:19:52 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 16 weeks, 5 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-2323</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>
                            1 year, 16 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21.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>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|i0wkmn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0fgls:</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="6122">Sharding EMEA 2022-06-13</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|i0w6rz:</customfieldvalue>

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