<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:17:52 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-48700] Add fuzz testing to ensure that the plan cache preserves query correctness</title>
                <link>https://jira.mongodb.org/browse/SERVER-48700</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48614&quot; title=&quot;Plan cache key computation for wildcard indexes with partialIndexFilter is incorrect, leading to incorrect query results&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48614&quot;&gt;&lt;del&gt;SERVER-48614&lt;/del&gt;&lt;/a&gt; is an example of a subtle issue around correctness of the plan cache that was not caught by any of our hand-written or auto-generated correctness tests. The plan cache code has some intricate logic around computation of the plan cache key based on the query itself as well as the current set of indexes. Queries which cannot always share the same execution plan (due to correctness concerns around things like null semantics, collation, partial indexes, and wildcard indexes) must be assigned different plan cache keys. Failure to discriminate between queries that can and can&apos;t share an execution plan can lead to the system incorrectly using a cached plan, ultimately resulting in incorrect results.&lt;/p&gt;

&lt;p&gt;Bugs of this class can be hard to observe or reproduce because they depend on having the plan cache in a particular state. This state is in-memory only, and does not persist across server restarts. It is also per-node state that does not replicate. It cannot be injected directly, but rather must be established indirectly by running queries. Finally, the fact that plan cache entries can be either &quot;active&quot; or &quot;inactive&quot; (see &lt;a href=&quot;https://docs.mongodb.com/manual/core/query-plans/#plan-cache-entry-state&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/core/query-plans/#plan-cache-entry-state&lt;/a&gt;) can complicate testing.&lt;/p&gt;

&lt;p&gt;In order to supplement our hand-written unit tests and integration tests for this part of the system, we could augment our various generational fuzz testing suites in order to provide better plan cache-related test coverage. I brainstormed a few ideas around this with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=ian.boros&quot; class=&quot;user-hover&quot; rel=&quot;ian.boros&quot;&gt;ian.boros&lt;/a&gt;:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;We could introduce a flag which causes queries to circumvent the plan cache. Then we could have a fuzzer variant which compares a server with the plan cache enabled against a server with the plan cache disabled.&lt;/li&gt;
	&lt;li&gt;We could run queries multiple times in the fuzzer and assert that we get the same result set each time. Multiple executions of a query shape are required in order to produce an active plan cache entry. This type of assertion would prove that queries get the same results when their plan is taken from the cache versus planned from scratch.&lt;/li&gt;
	&lt;li&gt;Even without comparing the result sets from multiple runs of the same query, the existing generational fuzzer suites could change to run the same query multiple times. This would make it more likely that the server creates active plan cache entries, and therefore could expose plan cache bugs in suites such as the multiversion agg fuzzer.&lt;/li&gt;
	&lt;li&gt;We could add some kind of command to pre-populate the cache and make the fuzzer use this tool to add cache entries before running queries?&lt;/li&gt;
	&lt;li&gt;We could run the fuzzer with inactive cache entries disabled. This would increase the likelihood of plans being recovered from the cache during fuzz testing.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;It&apos;s not clear which of these ideas gives us the most bang for our buck, but it would be nice to have something of this kind to mitigate the risk of future bugs such as &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48614&quot; title=&quot;Plan cache key computation for wildcard indexes with partialIndexFilter is incorrect, leading to incorrect query results&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48614&quot;&gt;&lt;del&gt;SERVER-48614&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1377520">SERVER-48700</key>
            <summary>Add fuzz testing to ensure that the plan cache preserves query correctness</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-execution">Backlog - Query Execution</assignee>
                                    <reporter username="david.storch@mongodb.com">David Storch</reporter>
                        <labels>
                            <label>qexec-team</label>
                    </labels>
                <created>Wed, 10 Jun 2020 19:51:25 +0000</created>
                <updated>Tue, 6 Dec 2022 02:24:34 +0000</updated>
                                                                            <component>Querying</component>
                    <component>Testing Infrastructure</component>
                                        <votes>1</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3204518" author="ralf.strobel" created="Thu, 11 Jun 2020 05:17:37 +0000"  >&lt;p&gt;Yup, can definitely confirm the &quot;hard to observe or reproduce&quot; part regarding &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48614&quot; title=&quot;Plan cache key computation for wildcard indexes with partialIndexFilter is incorrect, leading to incorrect query results&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48614&quot;&gt;&lt;del&gt;SERVER-48614&lt;/del&gt;&lt;/a&gt;. Took our customer support a month to take it serious, because it was not reliably reproducible. Then once we finally had a system to observe it on somewhat reliably, it took three of our engineers about a day to finally nail it down.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1373530">SERVER-48614</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>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25125"><![CDATA[Query Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 11 Jun 2020 05:17:37 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 35 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>
                            3 years, 35 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-query-execution</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>ralf.strobel</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxpedb:</customfieldvalue>

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

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