<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:31: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-32895] Provide method for getting &apos;current resume token&apos; for a collection</title>
                <link>https://jira.mongodb.org/browse/SERVER-32895</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Having a way to query the collection for the most recent resume token is extremely useful for providing that on server startup to clients who are being sent initial data and then relying on the resume tokens to keep them &apos;up to date&apos; and in &apos;real time&apos;, even after a disconnect.&lt;/p&gt;

&lt;p&gt;Scenario:&lt;/p&gt;

&lt;p&gt;ServerA makes rare changes to CollectionA via some mechanism.&lt;/p&gt;

&lt;p&gt;ServerB provides an endpoint which allows BrowserB to get all documents from CollectionA and keep up to date with any changes(via change streams) made to the collection(whether via other Browsers interacting with ServerB, or the occasional update ServerA makes).  However, no update has been made yet to CollectionA, so when the initial CollectionA is queried for all docs, BrowserB gets it, but ServerB does not have a resume token to send along after it is done(no updates have been made to CollectionA yet).&lt;/p&gt;

&lt;p&gt;ServerB crashes, disconnecting from BrowserB&lt;/p&gt;

&lt;p&gt;BrowserB is trying to reconnect to ServerB&lt;/p&gt;

&lt;p&gt;ServerA makes an update to CollectionA&lt;/p&gt;

&lt;p&gt;ServerB starts up again, no updates since start so no resume token for CollectionA&lt;/p&gt;

&lt;p&gt;BrowserB reconnects, but has no resume token.&lt;/p&gt;

&lt;p&gt;At this point, since ServerB was unable to send to BrowserB the current resume token for CollectionA right after initially sending the collection, nobody knows where to resume from, and the entire collection will have to be resent, rather than taking advantage of the resumability of change streams.&lt;/p&gt;

&lt;p&gt;If ServerB was able to ask for CollectionA&apos;s resume token and pass that along with the end of streaming the documents intially, then BrowserB would simply reconnect to the newly up server, providing it&apos;s resume token, and catch back up from where it left off, getting the update from ServerA and moving on along.&lt;/p&gt;

&lt;p&gt;The only way to hack around this that I know of is to force an update to a document on server up to get a resume token so you can send that along to anyone who requests streaming.  Providing the capability to simply ask for what was the last resume token for a given collection prevents the need for this ugly hack.&lt;/p&gt;</description>
                <environment></environment>
        <key id="487337">SERVER-32895</key>
            <summary>Provide method for getting &apos;current resume token&apos; for a collection</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="3">Duplicate</resolution>
                                        <assignee username="backlog-server-query">Backlog - Query Team</assignee>
                                    <reporter username="rgrimball">Robert Grimball</reporter>
                        <labels>
                            <label>changestreams</label>
                    </labels>
                <created>Thu, 25 Jan 2018 16:27:54 +0000</created>
                <updated>Tue, 6 Dec 2022 03:40:18 +0000</updated>
                            <resolved>Tue, 13 Aug 2019 15:04:23 +0000</resolved>
                                    <version>3.6.0</version>
                    <version>3.6.1</version>
                    <version>3.6.2</version>
                                                    <component>Aggregation Framework</component>
                                        <votes>2</votes>
                                    <watches>14</watches>
                                                                                                                <comments>
                            <comment id="2371012" author="fox.bob@gmail.com" created="Wed, 14 Aug 2019 16:44:08 +0000"  >&lt;p&gt;Thank you @&quot;Charlie Swanson&quot; I&apos;ve also now discovered &quot;startAtOperationTime&quot; parameter in Collection.watch(), but one question worth asking... how can I get the &lt;b&gt;server&lt;/b&gt; time from MongoDB?&#160; I don&apos;t want to use client generated timestamps.&lt;/p&gt;</comment>
                            <comment id="2368698" author="charlie.swanson" created="Tue, 13 Aug 2019 15:04:23 +0000"  >&lt;p&gt;Great. I&apos;m going to close this issue as a duplicate. Please leave a comment if you believe this is incorrect and explain the difference if so.&lt;/p&gt;</comment>
                            <comment id="2367987" author="bernard.gorman" created="Tue, 13 Aug 2019 01:12:14 +0000"  >&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;: yes, I believe the high-water-mark feature completed under &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35740&quot; title=&quot;Report high-water-mark resume token with each (possibly empty) change stream batch&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35740&quot;&gt;&lt;del&gt;SERVER-35740&lt;/del&gt;&lt;/a&gt; meets all the criteria set out in this ticket. In 4.0.7 and newer versions of MongoDB, every change stream batch will always return an up-to-date resume token, even if no actual events have occurred. And, as indicated by the spec document which you linked in your comment, recent drivers expose a convenient API to retrieve the latest resume token.&lt;/p&gt;</comment>
                            <comment id="2367877" author="charlie.swanson" created="Mon, 12 Aug 2019 22:33:04 +0000"  >&lt;p&gt;Forgive me as it is not the most legible description, but I think that we solved this in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-35740&quot; title=&quot;Report high-water-mark resume token with each (possibly empty) change stream batch&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-35740&quot;&gt;&lt;del&gt;SERVER-35740&lt;/del&gt;&lt;/a&gt;. The drivers should have a helper (or maybe soon will have a helper) to give a resume token even if there are no results: &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/change-streams/change-streams.rst#exposing-all-resume-tokens&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/blob/master/source/change-streams/change-streams.rst#exposing-all-resume-tokens&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Does that look like it would work for your use case &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=fox.bob%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;fox.bob@gmail.com&quot;&gt;fox.bob@gmail.com&lt;/a&gt; and/or &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rgrimball&quot; class=&quot;user-hover&quot; rel=&quot;rgrimball&quot;&gt;rgrimball&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=bernard.gorman&quot; class=&quot;user-hover&quot; rel=&quot;bernard.gorman&quot;&gt;bernard.gorman&lt;/a&gt; do you think we should close this ticket as a duplicate?&lt;/p&gt;</comment>
                            <comment id="2367448" author="fox.bob@gmail.com" created="Mon, 12 Aug 2019 19:01:03 +0000"  >&lt;p&gt;Change streams are important for Mongo DB!&#160; I can&apos;t really use them without this functionality... the ability to resume a stream without first seeing a change.&#160; If you don&apos;t incorporate this basic stuff you&apos;re basically telling people: go use Kafka.&lt;/p&gt;</comment>
                            <comment id="1785965" author="thomas.schubert" created="Fri, 26 Jan 2018 15:52:00 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=rgrimball&quot; class=&quot;user-hover&quot; rel=&quot;rgrimball&quot;&gt;rgrimball&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for the improvement request. We&apos;ve put this ticket on our backlog, and we&apos;ll update the fixversion if it is scheduled for a release.&lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br/&gt;
Kelsey&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="562934">SERVER-35740</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_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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 25 Jan 2018 16:33:06 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 26 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-query</customfieldvalue>
            <customfieldvalue>bernard.gorman@mongodb.com</customfieldvalue>
            <customfieldvalue>charlie.swanson@mongodb.com</customfieldvalue>
            <customfieldvalue>kelsey.schubert@mongodb.com</customfieldvalue>
            <customfieldvalue>fox.bob@gmail.com</customfieldvalue>
            <customfieldvalue>rgrimball</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htor1b:</customfieldvalue>

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

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