<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:54:49 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-84368] CreateIndex fails with StaleConfig if run from a stale mongos against a sharded non-empty collection</title>
                <link>https://jira.mongodb.org/browse/SERVER-84368</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently spotted a bug where given 2 mongos:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;mongos1 : create a non-empty sharded collection&lt;/li&gt;
	&lt;li&gt;mongos2: drop the collection and &lt;b&gt;shards it as timeseries&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;in case mongos1 (which is now stale) runs createIndex it will fail 10 times without trying a refresh.&#160;&lt;/p&gt;

&lt;p&gt;I attached a test to reproduce the error which is unclear. &lt;br/&gt;
The goal of the ticket is to investigate what is causing this issue.&lt;/p&gt;

&lt;p&gt;Important notes:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;the issue does not happen if mongos1 creates an empty sharded collection (skip the insert)&lt;/li&gt;
	&lt;li&gt;the issue does not happen if mongos2 creates a non-timeseries sharded collection&lt;/li&gt;
	&lt;li&gt;the issue only happens because mongos1 does not refresh, but attempts again with the same version for 10 times&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The ticket is necessary for track unsharded collection since after &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-81190&quot; title=&quot;Support tracking &amp;quot;simple&amp;quot; unsharded collections in the sharding catalog&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-81190&quot;&gt;&lt;del&gt;SERVER-81190&lt;/del&gt;&lt;/a&gt; it will happen even if mongos1 just runs a insert.&#160;&lt;/p&gt;

&lt;p&gt;Once the ticket is done, please fix the &lt;a href=&quot;https://github.com/search?q=repo%3Amongodb%2Fmongo+SERVER-84368&amp;amp;type=Code&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;TODO&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="2530446">SERVER-84368</key>
            <summary>CreateIndex fails with StaleConfig if run from a stale mongos against a sharded non-empty collection</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="marcos.grillo@mongodb.com">Marcos Jos&#233; Grillo Ramirez</assignee>
                                    <reporter username="enrico.golfieri@mongodb.com">Enrico Golfieri</reporter>
                        <labels>
                            <label>car-qw</label>
                            <label>investigation</label>
                    </labels>
                <created>Thu, 21 Dec 2023 09:22:37 +0000</created>
                <updated>Tue, 30 Jan 2024 10:41:50 +0000</updated>
                            <resolved>Thu, 25 Jan 2024 16:44:11 +0000</resolved>
                                                    <fixVersion>8.0.0-rc0</fixVersion>
                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="6038996" author="xgen-internal-githook" created="Wed, 24 Jan 2024 20:11:22 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Marcos Grillo&apos;, &apos;email&apos;: &apos;marcos.grillo@mongodb.com&apos;, &apos;username&apos;: &apos;m4nti5&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-84368&quot; title=&quot;CreateIndex fails with StaleConfig if run from a stale mongos against a sharded non-empty collection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-84368&quot;&gt;&lt;del&gt;SERVER-84368&lt;/del&gt;&lt;/a&gt; Invalidate catalog cache original nss if staleInfo exception is received for timeseries collection (#18004)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-84368&quot; title=&quot;CreateIndex fails with StaleConfig if run from a stale mongos against a sharded non-empty collection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-84368&quot;&gt;&lt;del&gt;SERVER-84368&lt;/del&gt;&lt;/a&gt; Invalidate catalog cache original nss if staleInfo&lt;br/&gt;
exception is received for timeseries collection&lt;/p&gt;

&lt;p&gt;Co-authored-by: Allison Easton &amp;lt;allison.easton@mongodb.com&amp;gt;&lt;br/&gt;
GitOrigin-RevId: b5f58d8cc3853c3bdecba44bf3fdf419fa200cf8&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/c10df9849621573d5bdf470b2ea69a6253a36521&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/c10df9849621573d5bdf470b2ea69a6253a36521&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">
                                        <issuelink>
            <issuekey id="2445899">SERVER-81190</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2139156">SERVER-69776</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.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="26387"><![CDATA[Catalog and Routing]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="27038"><![CDATA[v7.3]]></customfieldvalue>
    <customfieldvalue key="25578"><![CDATA[v7.0]]></customfieldvalue>
    <customfieldvalue key="23470"><![CDATA[v6.0]]></customfieldvalue>
    <customfieldvalue key="21777"><![CDATA[v5.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_23577" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>CAR Impact</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25717"><![CDATA[4 Data loss/Availability]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 21 Dec 2023 11:49:09 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 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>enrico.golfieri@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>marcos.grillo@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i35kwn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i2nbzo:</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="8006">CAR Team 2024-01-22</customfieldvalue>
    <customfieldvalue id="8007">CAR Team 2024-02-05</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;const dbName = &apos;testDB&apos;;&lt;br/&gt;
const collName = &apos;testColl&apos;;&lt;br/&gt;
const bucketsCollName = &apos;system.buckets.&apos; + collName;&lt;br/&gt;
const timeField = &apos;time&apos;;&lt;br/&gt;
const metaField = &apos;hostid&apos;;&lt;br/&gt;
// Connections.&lt;br/&gt;
&#160;&lt;br/&gt;
const st = new ShardingTest({mongos: 2, shards: 2, rs: {nodes: 2}});&lt;br/&gt;
const mongos0 = st.s0.getDB(dbName);&lt;br/&gt;
const mongos1 = st.s1.getDB(dbName);&lt;br/&gt;
const shard0DB = st.shard0.getDB(dbName);&lt;br/&gt;
const shard1DB = st.shard1.getDB(dbName);&lt;br/&gt;
&#160;&lt;br/&gt;
// Insert some dummy data using &apos;mongos1&apos; as the router, so that the cache is&lt;br/&gt;
// initialized on the mongos while the collection is unsharded.&lt;br/&gt;
assert.commandWorked(&lt;br/&gt;
mongos1.adminCommand({shardCollection: `${dbName}.${collName}`, key: {_id: 1}}));&lt;br/&gt;
assert.commandWorked(mongos1.getCollection(collName).insert({_id: &quot;aaa&quot;}));&lt;br/&gt;
&#160;&lt;br/&gt;
// Drop and shard the collection with &apos;mongos0&apos; as the router.&lt;br/&gt;
assert(mongos0.getCollection(collName).drop());&lt;br/&gt;
&#160;&lt;br/&gt;
const shardKey = &lt;/p&gt;
{
[metaField]: 1
}
&lt;p&gt;;&lt;br/&gt;
assert.commandWorked(mongos0.adminCommand({&lt;br/&gt;
shardCollection: `${dbName}.${collName}`,&lt;br/&gt;
key: shardKey,&lt;br/&gt;
timeseries: {timeField: timeField, metaField: metaField}&lt;br/&gt;
}));&lt;br/&gt;
&#160;&lt;br/&gt;
let cmdObj = {createIndexes: collName, indexes: [{key: &lt;/p&gt;
{[timeField]: 1}
&lt;p&gt;, name: &quot;index_on_time&quot;}]};&lt;br/&gt;
assert.commandWorked(mongos1.runCommand(cmdObj));&lt;br/&gt;
&#160;&lt;br/&gt;
st.stop();&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</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|i3571z:</customfieldvalue>

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