<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:39:02 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>[GODRIVER-2619] Allow application to have continued access to for ChangeStream.Current without extra copy</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-2619</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;Currently if applications want to have continued access to &lt;tt&gt;ChangeStream.Current&lt;/tt&gt; after calling Next/TryNext, they have to make a copy of it. This is every inefficient for applications that usually get large change events, and continued access for change streams is very common, for example putting the current event to a queue for async processing. It seems that the reason we have to do this is because the &lt;tt&gt;ChangeStream.Current&lt;/tt&gt; slice can be overwritten, so this ticket is to improve the implementation to avoid applications doing extra copy.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2167958">GODRIVER-2619</key>
            <summary>Allow application to have continued access to for ChangeStream.Current without extra copy</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="13203">Gone away</resolution>
                                        <assignee username="preston.vasquez@mongodb.com">Preston Vasquez</assignee>
                                    <reporter username="wenbin.zhu@mongodb.com">Wenbin Zhu</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Oct 2022 21:44:35 +0000</created>
                <updated>Fri, 27 Oct 2023 20:01:10 +0000</updated>
                            <resolved>Tue, 28 Mar 2023 12:00:50 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="5305567" author="dbeng-pm-bot" created="Tue, 28 Mar 2023 12:00:52 +0000"  >&lt;p&gt;There hasn&apos;t been any recent activity on this ticket, so we&apos;re resolving it. Thanks for reaching out! Please feel free to comment on this if you&apos;re able to provide more information.&lt;/p&gt;</comment>
                            <comment id="5267182" author="dbeng-pm-bot" created="Mon, 13 Mar 2023 12:01:00 +0000"  >&lt;p&gt;Hey &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=wenbin.zhu%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;wenbin.zhu@mongodb.com&quot;&gt;wenbin.zhu@mongodb.com&lt;/a&gt;, We need additional details to investigate the problem. If this is still an issue for you, please provide the requested information.&lt;/p&gt;</comment>
                            <comment id="5248211" author="JIRAUSER1258790" created="Fri, 3 Mar 2023 21:08:11 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=preston.vasquez%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;preston.vasquez@mongodb.com&quot;&gt;preston.vasquez@mongodb.com&lt;/a&gt; C2C does use a buffered channel for async event processing, the problem is that we need to make a deep copy of the event before putting into the channel because &lt;tt&gt;cs.Current&lt;/tt&gt; slice can be overwritten (see &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/d957e67/mongo/change_stream.go#L69-L70&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this comment&lt;/a&gt;).&lt;/p&gt;

&lt;blockquote&gt;

&lt;p&gt;Sending on the channel would still copy data under the hood&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I&apos;m a bit skeptical about this. The change event is basically a slice, and IIUC sending on channel only copies the slice data structure which is a shallow copy, it doesn&apos;t copy the actual array backing the slice. According to &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/d957e67/mongo/change_stream.go#L69-L70&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this comment&lt;/a&gt;, it seems we need to do a deep copy instead of a shallow one to be safe. C2C currently does a deep copy of the event before putting it into the buffered channel, and we&apos;d like to avoid such deep copy.&lt;/p&gt;</comment>
                            <comment id="4930291" author="JIRAUSER1258790" created="Wed, 26 Oct 2022 21:49:23 +0000"  >&lt;p&gt;I&apos;m not sure if doing this improvement would result in API changes, I hope it doesn&apos;t have to.&lt;/p&gt;</comment>
                            <comment id="4930277" author="JIRAUSER1258790" created="Wed, 26 Oct 2022 21:46:52 +0000"  >&lt;p&gt;C2C can benefit from this when customers have large change events.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_21553" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Quarter</customfieldname>
                        <customfieldvalues>
                                        <label>FY24Q1</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6jqv:s0002a</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>