<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:27:57 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-31707] Test changeStreams on a sharded collection where the shard doesn&apos;t know the collection is sharded</title>
                <link>https://jira.mongodb.org/browse/SERVER-31707</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The shard collection command makes a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a4a94724dc82af8a314f98c2245d4e61233f56bf/src/mongo/s/catalog/sharding_catalog_manager_collection_operations.cpp#L296&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;best-effort attempt&lt;/a&gt; to inform the primary shard that the collection is now sharded, but that message is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a4a94724dc82af8a314f98c2245d4e61233f56bf/src/mongo/s/catalog/sharding_catalog_manager_collection_operations.cpp#L312&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;not required to be delivered&lt;/a&gt;.  This means that the primary shard owning the previously unsharded collection may not know that the collection is now sharded, even after it is.&lt;/p&gt;

&lt;p&gt;We should test that if we get into a situation like that we can still establish a changeStream through a mongos that &lt;b&gt;does&lt;/b&gt; know that the collection is sharded.&lt;/p&gt;</description>
                <environment></environment>
        <key id="450304">SERVER-31707</key>
            <summary>Test changeStreams on a sharded collection where the shard doesn&apos;t know the collection is sharded</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="nicholas.zolnierz@mongodb.com">Nicholas Zolnierz</assignee>
                                    <reporter username="spencer@mongodb.com">Spencer Brody</reporter>
                        <labels>
                    </labels>
                <created>Tue, 24 Oct 2017 22:34:47 +0000</created>
                <updated>Mon, 30 Oct 2023 23:12:33 +0000</updated>
                            <resolved>Sun, 3 Dec 2017 00:48:03 +0000</resolved>
                                                    <fixVersion>3.6.3</fixVersion>
                    <fixVersion>3.7.1</fixVersion>
                                    <component>Aggregation Framework</component>
                    <component>Replication</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="1770745" author="xgen-internal-githook" created="Wed, 10 Jan 2018 20:56:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;nicholas.zolnierz@mongodb.com&apos;, &apos;name&apos;: &apos;Nick Zolnierz&apos;, &apos;username&apos;: &apos;nzolnierzmdb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-31707&quot; title=&quot;Test changeStreams on a sharded collection where the shard doesn&amp;#39;t know the collection is sharded&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-31707&quot;&gt;&lt;del&gt;SERVER-31707&lt;/del&gt;&lt;/a&gt;: Test changeStreams on a sharded collection where the shard doesn&apos;t know the collection is sharded&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 09d3d18293c33019814aa4c4ec4a5d8437f06718)&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/e30ccaa2ec1a68607513e1c2316a374736ec4eba&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/e30ccaa2ec1a68607513e1c2316a374736ec4eba&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1740893" author="xgen-internal-githook" created="Sun, 3 Dec 2017 00:47:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;nzolnierzmdb&apos;, &apos;email&apos;: &apos;nicholas.zolnierz@mongodb.com&apos;, &apos;name&apos;: &apos;Nick Zolnierz&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-31707&quot; title=&quot;Test changeStreams on a sharded collection where the shard doesn&amp;#39;t know the collection is sharded&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-31707&quot;&gt;&lt;del&gt;SERVER-31707&lt;/del&gt;&lt;/a&gt;: Test changeStreams on a sharded collection where the shard doesn&apos;t know the collection is sharded&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/09d3d18293c33019814aa4c4ec4a5d8437f06718&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/09d3d18293c33019814aa4c4ec4a5d8437f06718&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1711461" author="spencer" created="Fri, 27 Oct 2017 18:40:49 +0000"  >&lt;p&gt;I confirmed with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=charlie.swanson&quot; class=&quot;user-hover&quot; rel=&quot;charlie.swanson&quot;&gt;charlie.swanson&lt;/a&gt; that the mongod decides whether to do the updateLookup locally or defer it to the mongos based on whether the &lt;b&gt;mongos&lt;/b&gt; believes the collection to be sharded, so I don&apos;t think there will be an issue with both mongos and mongod running the updateLookup.&lt;/p&gt;

&lt;p&gt;So I believe this should be no worse than the case where the stream is established when the collection is unsharded and then it later becomes sharded.  Still probably worth testing to confirm and understand the current behavior.&lt;/p&gt;</comment>
                            <comment id="1708083" author="esha.maharishi@10gen.com" created="Tue, 24 Oct 2017 22:57:06 +0000"  >&lt;p&gt;There&apos;s a (maybe smaller) wrinkle - will mongos attach version UNSHARDED to shards it believes don&apos;t own any chunks?&lt;/p&gt;

&lt;p&gt;If so, if a shard donates its last chunk, I don&apos;t think we reset its CollectionMetadata, and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/r3.6.0-rc1/src/mongo/db/s/sharding_state.cpp?#L540-L547&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;even making that shard refresh won&apos;t cause its CollectionMetadata to reflect version UNSHARDED&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this case, mongos may never be able to establish the change streams cursor, because it will keep getting a stale shard version error from that shard.&lt;/p&gt;</comment>
                            <comment id="1708077" author="spencer" created="Tue, 24 Oct 2017 22:48:08 +0000"  >&lt;p&gt;I wonder if this could be solved by just actually sending a shard version on the agg we send from mongos to mongod.  We originally opt-ed out of the versioning protocol because we need changeStreams to target &lt;b&gt;all&lt;/b&gt; shards, not just the shards that have chunks, so we didn&apos;t want to hook into the existing mongos targeting/refresh logic.  We still need to target all shards, but I wonder if it would actually be harmful to just also do versioning.  That would at least ensure that the mongod had the right metadata when the cursor is established.  I think the only wrinkle would be making sure the mongos-side code was resilient to receiving a StaleShardVersion error during cursor establishment.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=charlie.swanson&quot; class=&quot;user-hover&quot; rel=&quot;charlie.swanson&quot;&gt;charlie.swanson&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=esha.maharishi&quot; class=&quot;user-hover&quot; rel=&quot;esha.maharishi&quot;&gt;esha.maharishi&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1708067" author="spencer" created="Tue, 24 Oct 2017 22:37:56 +0000"  >&lt;p&gt;If both the mongos and the mongod agree that the collection is unsharded then there shouldn&apos;t be a problem, it reduces to that case where a stream is established on an unsharded collection that then becomes sharded.&lt;/p&gt;

&lt;p&gt;I&apos;m worried about a situation where the mongos knows the collection is sharded but the mongod does not.  In that case the mongos might try to run the sharded-collection specific stages, but the mongod will not have included the shard key in the ResumeToken.  This seems like it could also be a problem for updateLookup, if both the mongod AND the mongos try to do the lookup.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="449940">SERVER-31691</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="440572">SERVER-31392</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>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="15141"><![CDATA[v3.6]]></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>Tue, 24 Oct 2017 22:57:06 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        6 years, 5 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_14262" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>End date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 24 Oct 2017 00:00:00 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-89</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>
                            6 years, 5 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>nicholas.zolnierz@mongodb.com</customfieldvalue>
            <customfieldvalue>spencer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htimvr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr9ca7:</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="1952">Query 2017-11-13</customfieldvalue>
    <customfieldvalue id="1979">Query 2017-12-04</customfieldvalue>
    <customfieldvalue id="2034">Query 2017-12-18</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_14261" key="com.atlassian.jira.plugin.system.customfieldtypes:datepicker">
                        <customfieldname>Start date</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 24 Oct 2017 00:00:00 +0000</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|hti8zj:</customfieldvalue>

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