<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:54:43 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-40352] Transactions that perform untimestamped reads do not check min visible snapshot for collection</title>
                <link>https://jira.mongodb.org/browse/SERVER-40352</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;After &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-38906&quot; title=&quot;Multi-document transactions should not perform timestamped read ahead of all-committed&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-38906&quot;&gt;&lt;del&gt;SERVER-38906&lt;/del&gt;&lt;/a&gt;, transactions with local or majority readConcern no longer read at a timestamp. This means that we will not check their read timestamp against the collection&apos;s minimum visible snapshot &lt;a href=&quot;https://github.com/mongodb/mongo/blob/cdeb454d59450cc3891e2902a440ca3b079c78ba/src/mongo/db/catalog_raii.cpp#L120&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;, so we allow these transactions to read from collections that were created after the transaction was opened. This is illegal in the storage engine. Instead we should record what the most recent visible timestamp is before the transaction, and then use that to check the min visible time when reading a collection.&lt;/p&gt;</description>
                <environment></environment>
        <key id="723599">SERVER-40352</key>
            <summary>Transactions that perform untimestamped reads do not check min visible snapshot for collection</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="tess.avitabile@mongodb.com">Tess Avitabile</assignee>
                                    <reporter username="tess.avitabile@mongodb.com">Tess Avitabile</reporter>
                        <labels>
                    </labels>
                <created>Tue, 26 Mar 2019 21:58:56 +0000</created>
                <updated>Fri, 23 Aug 2019 19:49:11 +0000</updated>
                            <resolved>Tue, 28 May 2019 13:26:45 +0000</resolved>
                                                                    <component>Replication</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="2261720" author="tess.avitabile" created="Tue, 28 May 2019 13:26:45 +0000"  >&lt;p&gt;As we have discussed above, since the concurrency test added in&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-41107&quot; title=&quot;Create concurrency test that accesses a collection in a transaction after catalog changes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-41107&quot;&gt;&lt;del&gt;SERVER-41107&lt;/del&gt;&lt;/a&gt; does not crash the server, we will not check the min visible snapshot for collections accessed in transactions that use untimestamped reads.&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-41107&quot; title=&quot;Create concurrency test that accesses a collection in a transaction after catalog changes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-41107&quot;&gt;&lt;del&gt;SERVER-41107&lt;/del&gt;&lt;/a&gt; would have crashed the server, if not for the fix already added in&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36005&quot; title=&quot;`IndexCatalogEntryImpl::_catalogIsReady` is unsafe to unconditionally call.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36005&quot;&gt;&lt;del&gt;SERVER-36005&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2242725" author="tess.avitabile" created="Fri, 10 May 2019 17:47:52 +0000"  >&lt;p&gt;I did a couple quick tests by creating a collection or index after the transaction had started and then using the collection/index in the transaction, and the tests did not crash the server. The next step will be to write an FSM test with transactions and DDL operation on the same collection. If the FSM test does not crash the server, then we will make no code changes.&lt;/p&gt;</comment>
                            <comment id="2239025" author="tess.avitabile" created="Wed, 8 May 2019 19:59:31 +0000"  >&lt;blockquote&gt;&lt;p&gt;My concern is that now we have a new visibility level that is neither a WT snapshot nor at/after a timestamp. It would introduce new anomalies, such as after renaming a collection you might not be able to see the collection at all. It neither exists under the old name nor the new one. Similarly, creating an index, even on a collection, would make the collection inaccessible.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;It&apos;s true that the solution I suggested would be a user experience regression, since in 4.0, if you create a collection with w:1, you can then access the collection in a transaction with local readConcern. With this change, the transaction might abort when you attempt to read from the collection. This would be a surprising abort, but we have other surprising aborts in 4.0 due to two-phase drops.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;I feel we&apos;re solving one specific problem causing extra complexity and creating more problems. I&apos;d rather do something simpler and more consistent, so having a client record the opTime of its last write and use the maximum of the all-committed point and that time for a transaction following that write.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The above solution has the issue that we would still be doing a timestamped read ahead of all-committed, which is illegal. It also wouldn&apos;t allow you to read your w:1 writes with local readConcern if you are using multiple clients.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=geert.bosch&quot; class=&quot;user-hover&quot; rel=&quot;geert.bosch&quot;&gt;geert.bosch&lt;/a&gt; suggested another solution, which is to wait for the lastApplied to become all-committed before starting a transaction with local readConcern. I would like to try this solution and test the performance impact. If the performance impact is not tolerable, I would like to pursue the solution I suggested, where we abort the transaction if a collection&apos;s min visible snapshot is greater than the &quot;read timestamp lower bound&quot;.&lt;/p&gt;

&lt;p&gt;I also realized that 4.0 may have a visibility problem due to performing timestamped reads ahead of the all-committed. Suppose a transaction starts a timestamped read at time 5. Then a collection is created at time 4. We will allow the transaction to read from the collection, even though the collection does not exist in the transaction&apos;s snapshot. Is this a bug?&lt;/p&gt;</comment>
                            <comment id="2238782" author="geert.bosch" created="Wed, 8 May 2019 17:15:49 +0000"  >&lt;p&gt;My concern is that now we have a new visibility level that is neither a WT snapshot nor at/after a timestamp. It would introduce new anomalies, such as after renaming a collection you might not be able to see the collection at all. It neither exists under the old name nor the new one. Similarly, creating an index, even on a collection, would make the collection inaccessible.&lt;/p&gt;

&lt;p&gt;I feel we&apos;re solving one specific problem causing extra complexity and creating more problems. I&apos;d rather do something simpler and more consistent, so having a client record the opTime of its last write and use the maximum of the all-committed point and that time for a transaction following that write.&lt;/p&gt;</comment>
                            <comment id="2237959" author="tess.avitabile" created="Tue, 7 May 2019 22:05:21 +0000"  >&lt;p&gt;My proposal is to record the all-committed as the &quot;read timestamp lower bound&quot; before opening the WT transaction. Each time we lock a new collection, we will check if the min visible snapshot for the collection is greater than the &quot;read timestamp lower bound&quot; and, if so, abort the transaction. This should ensure that there have been no catalog changes for that collection since the transaction was opened.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=geert.bosch&quot; class=&quot;user-hover&quot; rel=&quot;geert.bosch&quot;&gt;geert.bosch&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt;, can you consider this proposal?&lt;/p&gt;</comment>
                            <comment id="2198115" author="judah.schvimer" created="Mon, 1 Apr 2019 18:28:27 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=geert.bosch&quot; class=&quot;user-hover&quot; rel=&quot;geert.bosch&quot;&gt;geert.bosch&lt;/a&gt;, I don&apos;t understand why reading before the most recent visible timestamp would provide incorrect behavior. Can you please explain this to me?&lt;/p&gt;</comment>
                            <comment id="2197996" author="tess.avitabile" created="Mon, 1 Apr 2019 17:31:39 +0000"  >&lt;p&gt;From &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=geert.bosch&quot; class=&quot;user-hover&quot; rel=&quot;geert.bosch&quot;&gt;geert.bosch&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Traditionally we have relied on locking to avoid this anomaly: you first lock the collection, then you start your storage engine transaction which establishes a snapshot. Our 2-phase locking ensures that no collections can be created while you&apos;re using your snapshot. Because now an operation can access more than 1 collection, we don&apos;t have this guarantee. Instead we should record what the most recent visible timestamp is before the transaction, and then use that to check the min visible time when reading a collection. The fact that we don&apos;t do this is a bug.&lt;/p&gt;&lt;/blockquote&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="766367">SERVER-41107</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="905164">SERVER-43018</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="668173">SERVER-38906</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>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 1 Apr 2019 18:28:27 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 37 weeks, 1 day 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>daniel.gottlieb@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 37 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>geert.bosch@mongodb.com</customfieldvalue>
            <customfieldvalue>judah.schvimer@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|huryuv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|huhjmn:</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="2918">Repl 2019-04-22</customfieldvalue>
    <customfieldvalue id="2919">Repl 2019-05-06</customfieldvalue>
    <customfieldvalue id="2920">Repl 2019-05-20</customfieldvalue>
    <customfieldvalue id="2999">Repl 2019-06-03</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|hurl47:</customfieldvalue>

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