<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:48:49 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-82295] Classic and SBE plan cache API definition and naming clarity</title>
                <link>https://jira.mongodb.org/browse/SERVER-82295</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Improve the ease of working in the plan cache code, especially by creating a single, central API definition for each of the Classic and SBE plan caches; renaming classes, methods, functions, and data types to have consistent, unique, and non-generic names; and consolidating code into fewer places.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2477961">SERVER-82295</key>
            <summary>Classic and SBE plan cache API definition and naming clarity</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="10018" iconUrl="https://jira.mongodb.org/images/icons/statuses/visible.png" description="">In Code Review</status>
                    <statusCategory id="4" key="indeterminate" colorName="inprogress"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="kevin.cherkauer@mongodb.com">Kevin Cherkauer</assignee>
                                    <reporter username="kevin.cherkauer@mongodb.com">Kevin Cherkauer</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Oct 2023 17:27:29 +0000</created>
                <updated>Fri, 27 Oct 2023 23:00:15 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="5817601" author="JIRAUSER1270811" created="Fri, 27 Oct 2023 22:30:28 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/10gen/mongo/pull/16378&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;PR 16378&lt;/a&gt; is ready for review and is intended to be delivered as production code.&lt;/p&gt;


&lt;p&gt;The purpose of this PR is to make plan cache code easier to work with through several code hygiene practices. Most of the diff is from moving existing code around and renaming a number of types and methods, not fundamentally changing existing code or writing new code.&lt;/p&gt;

&lt;p&gt;Friction points this PR addresses:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;There was no central API definition for the plan cache.&lt;/li&gt;
	&lt;li&gt;Many actually different types, methods, and functions in different classes (usually Classic vs SBE) had the same names as each other.&lt;/li&gt;
	&lt;li&gt;It was difficult to distinguish shared, Classic-specific, and SBE-specific plan cache code, and this code was often mixed together in a single file or even a single method.&lt;/li&gt;
	&lt;li&gt;Some templatization existed that did not have benefits because the templatized types were not polymorphic with each other, so either the template just dispatched to separate methods or, in one case, to a shared method that mixed Classic-specific and SBE-specific code together and decided which blocks of code to execute inside that method based on checking whether the types that actually came in at runtime were Classic or SBE.&lt;/li&gt;
	&lt;li&gt;Code was scattered around in different files each with their own custom namespace, making it difficult to find all the code that together constituted the plan cache implementation.&lt;/li&gt;
	&lt;li&gt;Many functions and methods had very short, generic names (e.g. set(), get()) that made it impossible to easily grep to find all the uses of them because they were overwhelmed by thousands of extraneous hits.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;There was a barrier to fully consolidating the APIs because some pieces (classic_plan_cache.cpp, sbe_plan_cache.cpp, and their shared parent plan_cache.h) are in a separate, small build target that other components depend on, while the APIs for adding things to the plan cache exist in and depend on code from in a different, very large build target that other components probably don&apos;t want to depend on, and attempting to depend on it would probably create dependency cycles anyway. Therefore I was not able to move all the relevant APIs from the small library to the large one or vice versa, but the large library depends on the small one, so I created APIs in the large library that, in some cases, wrap APIs in the small library and made the APIs in the small library private. (In several cases making the small library APIs private required writing public methodNameTest() wrappers for them that are clearly commented as being for unit test use only, while the new API classes are made friend classes so they can call the private APIs. This is to discourage more APIs from being added in the small library that would again break the goal of having a single central official API definition for each plan cache. Production code should not call any &quot;xyzTest()&quot; methods.)&lt;/p&gt;

&lt;p&gt;The crux of this PR is the creation of central API definitions for each plan cache in one *.h file each:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Classic - classic_plan_cache_api.h&lt;/li&gt;
	&lt;li&gt;SBE - sbe_plan_cache_api.h&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;These consolidate APIs for&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Cache key creation&lt;/li&gt;
	&lt;li&gt;Cache retrieval&lt;/li&gt;
	&lt;li&gt;Cache updating&lt;/li&gt;
	&lt;li&gt;In SBE&apos;s case, also parameter binding (which does not exist in Classic)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There was not sufficient time during Skunkworks to try to consolidate auto-parameterization APIs, which is the last main piece of the SBE plan cache.&lt;/p&gt;</comment>
                    </comments>
                    <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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 27 Oct 2023 22:04:21 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        14 weeks, 5 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_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>kevin.cherkauer@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            14 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>kevin.cherkauer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2wo7r:</customfieldvalue>

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

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