<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:39:38 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-35379] com.mongodb.MongoQueryException: Query failed with error code 207 and error message &apos;Collection db.collection UUID differs from UUID on change stream operations&apos; on server &lt;host&gt;</title>
                <link>https://jira.mongodb.org/browse/SERVER-35379</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Hi team,&#160;&lt;/p&gt;

&lt;p&gt;We integrated the change streams and using mongo-java-driver, however we are facing below issue, interestingly it is working fine for one collection and failing for second collection, we opened change stream on two collections. &lt;/p&gt;

&lt;p&gt;Server version: 3.6.5&lt;br/&gt;
mongo-java-driver: 3.7.1 &lt;/p&gt;


&lt;p&gt;com.mongodb.MongoQueryException: Query failed with error code 207 and error message &apos;Collection &amp;lt;db&amp;gt;.&amp;lt;collection&amp;gt; UUID differs from UUID on change stream operations&apos; on server &amp;lt;mogos&amp;gt;:27017&lt;br/&gt;
	at com.mongodb.operation.QueryHelper.translateCommandException(QueryHelper.java:29)&lt;br/&gt;
	at com.mongodb.operation.QueryBatchCursor.getMore(QueryBatchCursor.java:229)&lt;br/&gt;
	at com.mongodb.operation.QueryBatchCursor.hasNext(QueryBatchCursor.java:115)&lt;br/&gt;
	at com.mongodb.operation.ChangeStreamBatchCursor$1.apply(ChangeStreamBatchCursor.java:58)&lt;br/&gt;
	at com.mongodb.operation.ChangeStreamBatchCursor$1.apply(ChangeStreamBatchCursor.java:55)&lt;br/&gt;
	at com.mongodb.operation.ChangeStreamBatchCursor.resumeableOperation(ChangeStreamBatchCursor.java:132)&lt;br/&gt;
	at com.mongodb.operation.ChangeStreamBatchCursor.hasNext(ChangeStreamBatchCursor.java:55)&lt;br/&gt;
	at com.mongodb.client.internal.MongoBatchCursorAdapter.hasNext(MongoBatchCursorAdapter.java:54)&lt;br/&gt;
	at .......&lt;br/&gt;
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)&lt;br/&gt;
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)&lt;br/&gt;
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)&lt;br/&gt;
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)&lt;br/&gt;
	at java.lang.Thread.run(Thread.java:748) &lt;/p&gt;

</description>
                <environment>staging, linux. </environment>
        <key id="553577">SERVER-35379</key>
            <summary>com.mongodb.MongoQueryException: Query failed with error code 207 and error message &apos;Collection db.collection UUID differs from UUID on change stream operations&apos; on server &lt;host&gt;</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="backlog-server-query">Backlog - Query Team</assignee>
                                    <reporter username="rajenderyes">Rajender Shanigaram</reporter>
                        <labels>
                    </labels>
                <created>Sun, 3 Jun 2018 23:21:18 +0000</created>
                <updated>Fri, 7 Apr 2023 16:56:58 +0000</updated>
                            <resolved>Mon, 9 Jul 2018 18:03:41 +0000</resolved>
                                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="2180040" author="esha.maharishi@10gen.com" created="Wed, 13 Mar 2019 18:59:12 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sjohnson540&quot; class=&quot;user-hover&quot; rel=&quot;sjohnson540&quot;&gt;sjohnson540&lt;/a&gt;, take a look at the user summary box on &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36154&quot; title=&quot;Shard&amp;#39;s in-memory CSS is not refreshed after upgrading from 3.4 to 3.6, causing a UUID mismatch on $changeStream operations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36154&quot;&gt;&lt;del&gt;SERVER-36154&lt;/del&gt;&lt;/a&gt; for a workaround.&lt;/p&gt;</comment>
                            <comment id="1947302" author="sjohnson540" created="Fri, 13 Jul 2018 22:07:25 +0000"  >&lt;p&gt;I just wanted to comment to say that I have also run into this issue. Steps I have taken to mitigate which have no effect:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Downgrade from 3.6.5 to 3.6.4&lt;/li&gt;
	&lt;li&gt;Stop reads/writes, restart mongos, mongod&lt;/li&gt;
	&lt;li&gt;Stopped all other changestream operations&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This is in a cluster that has been upgraded from 3.4, I started a changestream to watch a collection that was actively being used and the changestream failed with the UUID error mentioned above.&lt;/p&gt;

&lt;p&gt;This is in our staging environment and I have access to debug anything needed. I would be happy to help out in anyway I can to speed in the fixing of this issue as it is a blocker to us upgrading to 3.6 in production.&lt;/p&gt;</comment>
                            <comment id="1942671" author="rshanigaram" created="Tue, 10 Jul 2018 03:58:36 +0000"  >&lt;p&gt;Thank you Nik, I will follow&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35999&quot; title=&quot;A $changeStream can trigger assertion on UUID check when the collection cache is stale&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35999&quot;&gt;&lt;del&gt;SERVER-35999&lt;/del&gt;&lt;/a&gt; ticket.&#160;&lt;/p&gt;</comment>
                            <comment id="1942213" author="nicholas.zolnierz" created="Mon, 9 Jul 2018 18:03:41 +0000"  >&lt;p&gt;Closing this ticket and marking as a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35999&quot; title=&quot;A $changeStream can trigger assertion on UUID check when the collection cache is stale&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35999&quot;&gt;&lt;del&gt;SERVER-35999&lt;/del&gt;&lt;/a&gt;, which more accurately describes the underlying issue.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Nick&lt;/p&gt;</comment>
                            <comment id="1939581" author="nicholas.zolnierz" created="Thu, 5 Jul 2018 16:25:12 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rshanigaram&quot; class=&quot;user-hover&quot; rel=&quot;rshanigaram&quot;&gt;rshanigaram&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;We are unassigning this ticket and returning it to the backlog. However, this does not indicate that we are no longer working on this case. The issue is being investigated internally and has an associated ticket tracking the internal escalation. Unassigning this ticket simply avoids duplication in our internal work tracking. Feel free to respond with any questions or concerns.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
 Nick&lt;/p&gt;</comment>
                            <comment id="1915837" author="rshanigaram" created="Fri, 8 Jun 2018 22:34:01 +0000"  >&lt;p&gt;Nick, &lt;br/&gt;
1) I&apos;m sorry, as per our DBA team, there was a specific reason to use 3.6.5, not easy at this moment to downgrade to 3.6&lt;br/&gt;
2) No, it is a staging cluster as of now not deployed yet to production, not many writes/updates/deletes. &lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Rajender.S&lt;/p&gt;</comment>
                            <comment id="1913997" author="nicholas.zolnierz" created="Thu, 7 Jun 2018 16:46:18 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rshanigaram&quot; class=&quot;user-hover&quot; rel=&quot;rshanigaram&quot;&gt;rshanigaram&lt;/a&gt; it would also help to reproduce if you could provide more details on the other operations on the collection before and after opening the change stream.  Is it a live cluster with many writes/updates/deletes? If you can control it, I wouldn&apos;t expect the initial change stream to fail if it has nothing to return yet. Thanks in advance!&lt;/p&gt;</comment>
                            <comment id="1913913" author="nicholas.zolnierz" created="Thu, 7 Jun 2018 16:15:09 +0000"  >&lt;p&gt;Thanks for bearing with me, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rshanigaram&quot; class=&quot;user-hover&quot; rel=&quot;rshanigaram&quot;&gt;rshanigaram&lt;/a&gt;. There was one suspicious change stream commit that went into 3.6.5 that affects the commands that mongos sends to the shards.  If you could try with an older version of 3.6 and let me know if it still repros, that would be great.  &lt;/p&gt;

&lt;p&gt;Also do you mind posting the logs (with logLevel &amp;gt;= 2) for the failure? Unfortunately I haven&apos;t had any luck reproducing on my end.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Nick&lt;/p&gt;</comment>
                            <comment id="1913154" author="rshanigaram" created="Wed, 6 Jun 2018 22:37:38 +0000"  >&lt;p&gt;Thank you, Nicholas Zolnierz. &lt;br/&gt;
1)Different threads monitor on separate collection, not multiple threads on single collection, however I tried only one collection and one thread, specially it is failing for this particular collection only.  &lt;br/&gt;
2) Sure, I tried with single mongos and no luck. &lt;/p&gt;

&lt;p&gt;Thank you so much for looking into it. &lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Rajender.S&lt;/p&gt;</comment>
                            <comment id="1911501" author="nicholas.zolnierz" created="Tue, 5 Jun 2018 18:14:01 +0000"  >&lt;p&gt;Interesting, the issue may be related to concurrent change streams on multiple collections. If you haven&apos;t already, could you try removing one of the monitoring threads and just watch &quot;myCollection&quot;? &lt;/p&gt;

&lt;p&gt;Also would be worth running with a single mongos and multiple monitoring threads, since the driver has a somewhat random process for determining which mongos to route requests to. In the meantime I&apos;ll work on setting up a repro case that bypasses the driver. &lt;/p&gt;

&lt;p&gt;Thanks!&lt;br/&gt;
Nick&lt;/p&gt;</comment>
                            <comment id="1910674" author="rshanigaram" created="Mon, 4 Jun 2018 23:44:13 +0000"  >&lt;p&gt;1) Yes, &quot;myCollection&quot; is already created and sharded, this was an old collection. &lt;br/&gt;
2) Passing collection also go through example same code, I&apos;m creating two java threads, each one monitor single collection, create monitor thread is common code for both collection&lt;br/&gt;
3) I need full document on watch event, hence added UPDATE_LOOKUP, however I tried without fullDocument  like below and getting same exception&lt;br/&gt;
cursor = collection.watch().iterator();&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Rajender.S&lt;/p&gt;</comment>
                            <comment id="1910436" author="nicholas.zolnierz" created="Mon, 4 Jun 2018 20:24:31 +0000"  >&lt;p&gt;Thanks &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rshanigaram&quot; class=&quot;user-hover&quot; rel=&quot;rshanigaram&quot;&gt;rshanigaram&lt;/a&gt;, at a glance what you&apos;ve described should work.  And just to verify, &quot;myCollection&quot; is already created and sharded? Could you also provide more details on the passing case with the other collection? I don&apos;t think the UPDATE_LOOKUP option is relevant to the assertion, but it would be worth trying without it as well.&lt;/p&gt;
</comment>
                            <comment id="1910196" author="rshanigaram" created="Mon, 4 Jun 2018 18:17:48 +0000"  >&lt;p&gt;Thank you Nicholas Zolnierz, please find the details below, I&apos;m pretty sure that not dropping and re-create the collection. &lt;/p&gt;

&lt;p&gt;1) we got two datacenters: A, B each datacenter has 1 primary, 2 secondaries (one local and remote) &lt;br/&gt;
2) mongoclient connection opened by passing list of mongos host names -&amp;gt;  mongos1-A, mongos2-A, mongos1-B, mongos2-B &lt;br/&gt;
3) MongoCollection&amp;lt;Document&amp;gt; collection = database.getCollection(&quot;myCollection&quot;);&lt;br/&gt;
4) MongoCursor&amp;lt;ChangeStreamDocument&amp;lt;Document&amp;gt;&amp;gt; cursor = collection.watch().fullDocument(FullDocument.UPDATE_LOOKUP).iterator();&lt;br/&gt;
&amp;#8212;&lt;br/&gt;
while(cursor.hasNext()) &lt;/p&gt;
{
---
 ChangeStreamDocument&amp;lt;Document&amp;gt; changeEvent = cursor.next();
----
}

&lt;p&gt;Kindly let me know if you need any more details or if I miss any. &lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Rajender.S&lt;/p&gt;
</comment>
                            <comment id="1910105" author="nicholas.zolnierz" created="Mon, 4 Jun 2018 17:38:55 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rshanigaram&quot; class=&quot;user-hover&quot; rel=&quot;rshanigaram&quot;&gt;rshanigaram&lt;/a&gt;, &lt;/p&gt;

&lt;p&gt;The error that you&apos;re seeing implies that the collection being watched has been dropped and recreated as sharded, resulting in a new UUID for the collection. Attempting to iterate a change stream cursor on the original collection will trigger this assertion, with a sequence of events such as:&lt;/p&gt;

&lt;p&gt;1. Create collection and open a change stream on it.&lt;br/&gt;
2. Perform a write/update/delete operation.&lt;br/&gt;
3. Drop and recreate the sharded collection.&lt;br/&gt;
4. Attempt to get the next batch from the change stream cursor.  &lt;/p&gt;

&lt;p&gt;Can you include more details on the exact steps that you&apos;ve taken to hit the assertion? This will help us narrow down where to investigate next.&lt;/p&gt;

&lt;p&gt;Regards,&lt;br/&gt;
Nick &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                            <outwardlinks description="documents">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="568753">SERVER-35999</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>14.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25143"><![CDATA[Query]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[500A000000av0OPIAY]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 4 Jun 2018 02:20:18 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 48 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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 48 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-query</customfieldvalue>
            <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
            <customfieldvalue>nicholas.zolnierz@mongodb.com</customfieldvalue>
            <customfieldvalue>rajenderyes</customfieldvalue>
            <customfieldvalue>sjohnson540</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htzocv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htqlsf:</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_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|htzam7:</customfieldvalue>

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