<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:28:22 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-31847] Allow sharded $changeStream to continue if collection is dropped and resharded before documentKey is obtained</title>
                <link>https://jira.mongodb.org/browse/SERVER-31847</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;At present, we &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e7837911c89af144fe012e5063f8ca88c4c66956/src/mongo/db/pipeline/pipeline_d.cpp#L369-L372&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;uassert&lt;/tt&gt; if the current UUID of the sharded namespace on which the &lt;tt&gt;$changeStream&lt;/tt&gt; is running differs from the UUID found in the oplog entry&lt;/a&gt;, implying that the collection was dropped and resharded before we had a chance to obtain the shard key fields for the &lt;tt&gt;documentKey&lt;/tt&gt;. This prevents &lt;tt&gt;$changeStream&lt;/tt&gt; from returning the remaining oplog entries leading up to the original collection&apos;s invalidation.&lt;/p&gt;

&lt;p&gt;However, given that:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;We &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e7837911c89af144fe012e5063f8ca88c4c66956/src/mongo/db/pipeline/document_source_change_stream.cpp#L315-L321&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;cannot &lt;tt&gt;resumeAfter&lt;/tt&gt; on a dropped collection regardless&lt;/a&gt;, so the shard key fields are irrelevant for resume token purposes&lt;/li&gt;
	&lt;li&gt;&lt;tt&gt;mongoS&lt;/tt&gt; &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e7837911c89af144fe012e5063f8ca88c4c66956/src/mongo/s/commands/pipeline_s.cpp#L76-L82&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;will not attempt to &lt;tt&gt;updateLookup&lt;/tt&gt; the &lt;tt&gt;documentKey&lt;/tt&gt; if the current UUID does not match the operation UUID&lt;/a&gt; and will correctly add &lt;tt&gt;fullDocument:null&lt;/tt&gt; to the &lt;tt&gt;$changeStream&lt;/tt&gt; entry&lt;/li&gt;
	&lt;li&gt;Dropping the collection does not &lt;tt&gt;uassert&lt;/tt&gt;; only recreating it prevents &lt;tt&gt;$changeStream&lt;/tt&gt; from continuing&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;... it should be safe to simply return &lt;tt&gt;_id&lt;/tt&gt; for the &lt;tt&gt;documentKey&lt;/tt&gt; and allow &lt;tt&gt;$changeStream&lt;/tt&gt; to proceed. This would bring sharded &lt;tt&gt;$changeStream&lt;/tt&gt; into alignment with the behaviour on a single replica set, where dropping and recreating a collection in this way does &lt;b&gt;not&lt;/b&gt; prevent &lt;tt&gt;$changeStream&lt;/tt&gt; from retrieving the remainder of the old collection&apos;s oplog entries.&lt;/p&gt;</description>
                <environment></environment>
        <key id="455254">SERVER-31847</key>
            <summary>Allow sharded $changeStream to continue if collection is dropped and resharded before documentKey is obtained</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="bernard.gorman@mongodb.com">Bernard Gorman</reporter>
                        <labels>
                    </labels>
                <created>Mon, 6 Nov 2017 23:28:01 +0000</created>
                <updated>Mon, 30 Oct 2023 23:10:45 +0000</updated>
                            <resolved>Thu, 12 Apr 2018 21:27:37 +0000</resolved>
                                    <version>3.6.0-rc2</version>
                                    <fixVersion>3.7.4</fixVersion>
                                    <component>Aggregation Framework</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="1844116" author="asya" created="Sat, 24 Mar 2018 01:55:53 +0000"  >&lt;p&gt;This is different than the use case of collection becoming sharded (having previously been watched when it was unsharded).   That one might be &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-32088&quot; title=&quot;ChangeStream resumeAfter does not work on sharded collections if not all shards have chunks for the collection &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-32088&quot;&gt;&lt;del&gt;SERVER-32088&lt;/del&gt;&lt;/a&gt; I think.&lt;/p&gt;
</comment>
                            <comment id="1844115" author="asya" created="Sat, 24 Mar 2018 01:53:38 +0000"  >&lt;p&gt;I agree that it should continue until it gets to the drop in the oplog at which point it will invalidate the change stream (right?)&lt;/p&gt;</comment>
                            <comment id="1831057" author="charlie.swanson" created="Mon, 12 Mar 2018 18:03:22 +0000"  >&lt;p&gt;Bumping this out of the sprint in favor of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-32283&quot; title=&quot;Add an expression to inspect the resume token of a change stream&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-32283&quot;&gt;SERVER-32283&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="382748">SERVER-29134</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="449940">SERVER-31691</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.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_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>Mon, 12 Mar 2018 18:03:22 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 46 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-876</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>
                            5 years, 46 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>bernard.gorman@mongodb.com</customfieldvalue>
            <customfieldvalue>charlie.swanson@mongodb.com</customfieldvalue>
            <customfieldvalue>nicholas.zolnierz@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htjemv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr9dkf:</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="2265">Query 2018-05-07</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|htj0qn:</customfieldvalue>

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