<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:14:34 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-47574] Ban non-transaction snapshot reads on capped collections</title>
                <link>https://jira.mongodb.org/browse/SERVER-47574</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description></description>
                <environment></environment>
        <key id="1316313">SERVER-47574</key>
            <summary>Ban non-transaction snapshot reads on capped collections</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="lingzhi.deng@mongodb.com">Lingzhi Deng</assignee>
                                    <reporter username="lingzhi.deng@mongodb.com">Lingzhi Deng</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 Apr 2020 19:06:40 +0000</created>
                <updated>Sun, 29 Oct 2023 22:09:27 +0000</updated>
                            <resolved>Thu, 30 Apr 2020 22:07:06 +0000</resolved>
                                                    <fixVersion>4.7.0</fixVersion>
                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3063533" author="xgen-internal-githook" created="Thu, 30 Apr 2020 21:12:55 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Lingzhi Deng&apos;, &apos;email&apos;: &apos;lingzhi.deng@mongodb.com&apos;, &apos;username&apos;: &apos;ldennis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47574&quot; title=&quot;Ban non-transaction snapshot reads on capped collections&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47574&quot;&gt;&lt;del&gt;SERVER-47574&lt;/del&gt;&lt;/a&gt;: Ban non-transaction snapshot reads on capped collections&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/f1d2e697affa906307d8623bb3d3746acb1ae162&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/f1d2e697affa906307d8623bb3d3746acb1ae162&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3059169" author="tess.avitabile" created="Tue, 28 Apr 2020 18:24:44 +0000"  >&lt;p&gt;Yes, as we discussed, can you create a separate ticket for banning operations on capped collections inside transactions, and put that ticket into Needs Triage?&lt;/p&gt;</comment>
                            <comment id="3057414" author="lingzhi.deng" created="Mon, 27 Apr 2020 20:16:58 +0000"  >&lt;p&gt;Gotcha. Since this doesn&apos;t seem to be a new issue specific to snapshot reads outside of transaction, I will go ahead to ban snapshot reads on capped collections. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt;, should I also ban them inside transactions? I think we should and document the limitations.&lt;/p&gt;</comment>
                            <comment id="3057348" author="daniel.gottlieb@10gen.com" created="Mon, 27 Apr 2020 19:44:15 +0000"  >&lt;blockquote&gt;
&lt;p&gt;Do you think it is reasonable to error out snapshot reads on capped collections?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Yes&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Or is there an easy way to make them work (timestamping the delete?)?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I imagine that&apos;s relatively easy on primaries. I think secondaries would be harder: a delete associated with an insert at time 1 on a primary might happen on time 2 at a secondary, and time 3 on a different secondary! So the naive approach would likely result in a different problem to solve.&lt;/p&gt;</comment>
                            <comment id="3057293" author="lingzhi.deng" created="Mon, 27 Apr 2020 19:19:00 +0000"  >&lt;blockquote&gt;
&lt;p&gt;Capped collections typically (always?) delete records with an unreplicated/untimestamped write. Those deletions will always become visible in a newer transaction.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Ah, yes, I see. I think this is the reason. And good point about bumping the &lt;tt&gt;minVisibleTimestamp&lt;/tt&gt; when converting (if possible) a capped to a non-capped in order to ban reads at point in time before the conversion.&lt;/p&gt;

&lt;p&gt;Do you think it is reasonable to error out snapshot reads on capped collections? Or is there an easy way to make them work (timestamping the delete?)? &lt;/p&gt;</comment>
                            <comment id="3057273" author="daniel.gottlieb@10gen.com" created="Mon, 27 Apr 2020 19:06:26 +0000"  >&lt;blockquote&gt;
&lt;p&gt;Snapshot reads don&apos;t seem to work with capped collections possibly due to that capped collections use &quot;truncate&quot; to delete records.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The oplog gets called via WT&apos;s &lt;tt&gt;truncate&lt;/tt&gt; command yes, but that&apos;s not true for all capped deletions, nor is it the reason why a transaction yield/restore at the same timestamp across a capped deletion gives different results. Capped collections typically (always?) delete records with an unreplicated/untimestamped write. Those deletions will always become visible in a newer transaction.&lt;/p&gt;

&lt;p&gt;Moreover, it&apos;s possible to &lt;tt&gt;convertToCapped&lt;/tt&gt; a non-capped collection into a capped one. I&apos;m not sure if a capped collection can be made normal again. Presumably, if it could, we&apos;d need to bump the &lt;tt&gt;minVisibleTimestamp&lt;/tt&gt; such that the query of &quot;is this a capped collection&quot; is appropriately pseudo-versioned in the catalog.&lt;/p&gt;</comment>
                            <comment id="3056857" author="lingzhi.deng" created="Mon, 27 Apr 2020 16:36:23 +0000"  >&lt;p&gt;I think we may need to ban snapshot reads on capped collections in general. Snapshot reads don&apos;t seem to work with capped collections possibly due to that capped collections use &quot;truncate&quot; to delete records.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://docs.mongodb.com/manual/core/capped-collections/#transactions&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;documentation&lt;/a&gt; claims that&#160;&quot;Reads from capped collections are still supported in transactions.&quot; However, for snapshot reads inside transactions, if a transaction uses snapshot with an atClusterTime (e.g. coming from mongos), it seems that it might not see all the documents at that point in time if documents were deleted. Snapshot transactions without atClusterTime seems to work probably because they hold onto the WT txn and the snapshot.&lt;/p&gt;

&lt;p&gt;I attached the test file I used snapshot_reads_capped_collection.js. Grep for &quot;&amp;lt;---&quot; to see the command responses. For atCluserTime reads (both transaction and non-transaction), the find commands in the test return an empty result set.&lt;/p&gt;

&lt;p&gt;CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jesse&quot; class=&quot;user-hover&quot; rel=&quot;jesse&quot;&gt;jesse&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                        <issuelink>
            <issuekey id="1335100">DOCS-13624</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1331738">SERVER-47824</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1986119">SERVER-63813</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="257676" name="snapshot_reads_capped_collection.js" size="2386" author="lingzhi.deng@mongodb.com" created="Mon, 27 Apr 2020 19:01:08 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.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, 27 Apr 2020 19:06:26 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 40 weeks, 6 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_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Snapshot reads outside of transactions (PM-1504) are not allowed on capped collections.</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16942"><![CDATA[Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1504</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>
                            3 years, 40 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>daniel.gottlieb@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>lingzhi.deng@mongodb.com</customfieldvalue>
            <customfieldvalue>tess.avitabile@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxfidb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hx2zxr:</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="3881">Repl 2020-05-04</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_17051" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Teams Impacted</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16944"><![CDATA[Docs]]></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|hxf4mn:</customfieldvalue>

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