<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:19:32 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-71626] Failed to Presplit and create chunks in Sharded Cluster</title>
                <link>https://jira.mongodb.org/browse/SERVER-71626</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #fafbfc;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #fafbfc;&quot;&gt;
&lt;h3&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;PreSplit and allocate the required chunks in a sharded cluster&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;Motivation&quot;&gt;&lt;/a&gt;&lt;b&gt;Motivation&lt;/b&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;a name=&quot;Whoistheaffectedenduser%3F&quot;&gt;&lt;/a&gt;Who is the affected end user?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Developers who are trying to work in the sharded cluster environment&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Howdoesthisaffecttheenduser%3F&quot;&gt;&lt;/a&gt;How does this affect the end user?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;The developers are currently blocked and are using the sharded cluster without&lt;/em&gt;&#160;&lt;em&gt;pre splitting.&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Howlikelyisitthatthisproblemorusecasewilloccur%3F&quot;&gt;&lt;/a&gt;How likely is it that this problem or use case will occur?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;It occurs frequently.&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Iftheproblemdoesoccur%2Cwhataretheconsequencesandhowseverearethey%3F&quot;&gt;&lt;/a&gt;If the problem does occur, what are the consequences and how severe are they?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Not able to presplit and create chunks in sharded cluster&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisissueurgent%3F&quot;&gt;&lt;/a&gt;Is this issue urgent?&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Yeah&lt;/em&gt;&#160;&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Database name : chasetest&lt;/p&gt;

&lt;p&gt;Collection name: documents&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Steps:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;sh.disableBalancing(&quot;chasetest.documents&quot;)&lt;/p&gt;

&lt;p&gt;sh.startBalancer();&lt;/p&gt;

&lt;p&gt;sh.enableSharding(&quot;chasetest&quot;);&lt;/p&gt;

&lt;p&gt;sh.shardCollection(&apos;chasetest.documents&apos;, {&apos;SHARD_KEY&apos;:1})&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;for(x=0;x&amp;lt;840;x++) {&lt;/p&gt;

&lt;p&gt;&#160;&#160;&#160; print(`sh.splitAt(&quot;chasetest.documents&quot;, { &quot;SHARD_KEY&quot;: ${x} })`)&lt;/p&gt;

&lt;p&gt;&#160;&#160;&#160; printjson(sh.splitAt(&quot;chasetest.documents&quot;, {&quot;SHARD_KEY&quot;: x}))&lt;/p&gt;

&lt;p&gt;} &#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;MongoError: split failed :: caused by :: chunk operation commit failed: version 4|3||637fee532a5d9628d64e06eb||Timestamp(1669328467, 4) doesn&apos;t exist in namespace: chasetest.documents. Unable to save chunk ops. Command: { applyOps: [ { op: &quot;u&quot;, b: true, ns: &quot;config.chunks&quot;, o: { _id: ObjectId(&apos;637fee87f998b1216f78a0ef&apos;), uuid: UUID(&quot;61c91778-d277-44fe-bb42-f1ca936b7a14&quot;), min: &lt;/p&gt;
{ SHARD_KEY: 18 }
&lt;p&gt;, max: { SHARD_KEY: 20 }, shard: &quot;dev-65148-csi-gms-ingestion-api-dev-rs1&quot;, lastmod: Timestamp(4, 2), history: [ { validAfter: Timestamp(1669328467, 4), shard: &quot;dev-65148-csi-gms-ingestion-api-dev-rs1&quot; } ] }, o2: { _id: ObjectId(&apos;637fee87f998b1216f78a0ef&apos;) } }, { op: &quot;u&quot;, b: true, ns: &quot;config.chunks&quot;, o: { _id: ObjectId(&apos;637fee8df998b1216f78a180&apos;), uuid: UUID(&quot;61c91778-d277-44fe-bb42-f1ca936b7a14&quot;), min: &lt;/p&gt;
{ SHARD_KEY: 20 }
&lt;p&gt;, max: { SHARD_KEY: MaxKey }, shard: &quot;dev-65148-csi-gms-ingestion-api-dev-rs1&quot;, lastmod: Timestamp(4, 3), history: [ { validAfter: Timestamp(1669328467, 4), shard: &quot;dev-65148-csi-gms-ingestion-api-dev-rs1&quot; } ] }, o2: { _id: ObjectId(&apos;637fee8df998b1216f78a180&apos;) } } ], preCondition: [ { ns: &quot;config.chunks&quot;, q: { query: { min: &lt;/p&gt;
{ SHARD_KEY: 18 }
&lt;p&gt;, max: { SHARD_KEY: MaxKey }, uuid: UUID(&quot;61c91778-d277-44fe-bb42-f1ca936b7a14&quot;) }, orderby: { lastmod: -1 } }, res: { uuid: UUID(&quot;61c91778-d277-44fe-bb42-f1ca936b7a14&quot;), shard: &quot;dev-65148-csi-gms-ingestion-api-dev-rs1&quot; } } ], writeConcern: { w: 1, wtimeout: 0 } }. Result: { got: {}, whatFailed: { ns: &quot;config.chunks&quot;, q: { query: { min: &lt;/p&gt;
{ SHARD_KEY: 18 }
&lt;p&gt;, max: { SHARD_KEY: MaxKey }, uuid: UUID(&quot;61c91778-d277-44fe-bb42-f1ca936b7a14&quot;) }, orderby: { lastmod: -1 } }, res: { uuid: UUID(&quot;61c91778-d277-44fe-bb42-f1ca936b7a14&quot;), shard: &quot;dev-65148-csi-gms-ingestion-api-dev-rs1&quot; } }, ok: 0.0, errmsg: &quot;preCondition failed&quot;, code: 2, codeName: &quot;BadValue&quot;, $gleStats: { lastOpTime: &lt;/p&gt;
{ ts: Timestamp(1669328525, 6), t: 4 }
&lt;p&gt;, electionId: ObjectId(&apos;7fffffff0000000000000004&apos;) }, lastCommittedOpTime: Timestamp(1669328525, 6), $clusterTime: { clusterTime: Timestamp(1669328525, 6), signature: &lt;/p&gt;
{ hash: BinData(0, 0000000000000000000000000000000000000000), keyId: 0 }
&lt;p&gt; }, $configTime: Timestamp(1669328525, 6), $topologyTime: Timestamp(1658235601, 4), operationTime: Timestamp(1669328525, 6) } :: caused by :: preCondition failed&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>STG</environment>
        <key id="2195180">SERVER-71626</key>
            <summary>Failed to Presplit and create chunks in Sharded Cluster</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="3">Duplicate</resolution>
                                        <assignee username="jordi.serra-torrens@mongodb.com">Jordi Serra Torrens</assignee>
                                    <reporter username="rajesh.vinayagam@mongodb.com">Rajesh Vinayagam</reporter>
                        <labels>
                            <label>chunks</label>
                            <label>sharded-cluster</label>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Fri, 25 Nov 2022 21:23:08 +0000</created>
                <updated>Wed, 12 Apr 2023 12:40:49 +0000</updated>
                            <resolved>Wed, 12 Apr 2023 12:40:27 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="5340964" author="JIRAUSER1257318" created="Wed, 12 Apr 2023 12:39:48 +0000"  >&lt;p&gt;It&apos;s difficult to conclusively tell exactly what interleaving lead to this split failure, given that the report does not mention the server version nor include logs or a config dump. However, from the error message above I can infer that this must be 5.0 or greater (because the config.chunks document have the &apos;uuid&apos; field). &lt;/p&gt;

&lt;p&gt;I have not been able to reproduce the issue after following the steps in the report. I tried 5.0, 6.0 and master (~7.0).&lt;/p&gt;

&lt;p&gt;However, after code inspection I found one possible scenario where this can happen in 5.0, which I have been able to reproduce by using failpoints (attaching repro for the record &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/attachment/442434/442434_repro-server-71626.patch&quot; title=&quot;repro-server-71626.patch attached to SERVER-71626&quot;&gt;repro-server-71626.patch&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.mongodb.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; ). This scenario involves splitting chunks while the balancer is moving chunks to other shards. Certain interleaving can lead to the split being send to a shard that no longer owns that chunk, which results in the exact same symptom as the report. This was fixed in 5.1 by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-54979&quot; title=&quot;Calling move/split/mergeChunk after one another from different MongoS is not causally consistent &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-54979&quot;&gt;SERVER-54979&lt;/a&gt; (later reworked by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-68485&quot; title=&quot;Merge and Split commands should not use the CSR to check the shard version&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-68485&quot;&gt;&lt;del&gt;SERVER-68485&lt;/del&gt;&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;For this reason, I&apos;m going to mark this as duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-54979&quot; title=&quot;Calling move/split/mergeChunk after one another from different MongoS is not causally consistent &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-54979&quot;&gt;SERVER-54979&lt;/a&gt;/&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-68485&quot; title=&quot;Merge and Split commands should not use the CSR to check the shard version&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-68485&quot;&gt;&lt;del&gt;SERVER-68485&lt;/del&gt;&lt;/a&gt;. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rajesh.vinayagam%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;rajesh.vinayagam@mongodb.com&quot;&gt;rajesh.vinayagam@mongodb.com&lt;/a&gt; please reopen if this did not happen in 5.0.&lt;/p&gt;

&lt;p&gt;Additionally, I&apos;d like to point out that `sh.disableBalancing` must be run after `sh.shardCollection`. Otherwise `disableBalancing` has no effect because the sharded collection does not yet exists, and this could lead to the hypothesized migrations that ran concurrently with the split.  If you do that, I expect the split failures to stop happening.&lt;/p&gt;</comment>
                            <comment id="5314748" author="JIRAUSER1257318" created="Fri, 31 Mar 2023 09:16:55 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rajesh.vinayagam%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;rajesh.vinayagam@mongodb.com&quot;&gt;rajesh.vinayagam@mongodb.com&lt;/a&gt; can you share what server version is this on?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="1640575">SERVER-54979</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2104378">SERVER-68485</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="442434" name="repro-server-71626.patch" size="2444" author="jordi.serra-torrens@mongodb.com" created="Wed, 12 Apr 2023 12:39:44 +0000"/>
                    </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_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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 31 Mar 2023 09:16:55 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        43 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_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>jordi.serra-torrens@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            43 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>jordi.serra-torrens@mongodb.com</customfieldvalue>
            <customfieldvalue>rajesh.vinayagam@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i1k4cf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i12pt4:</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="6818">Sharding EMEA 2023-04-17</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|i1jqhr:</customfieldvalue>

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