<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:53:26 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-61835] Fix how SBE plan cache deals with ShardFilterer</title>
                <link>https://jira.mongodb.org/browse/SERVER-61835</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;A &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/exec/shard_filter.h#L76-L82&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ShardFilterer owns a ScopedCollectionFilter&lt;/a&gt; which represents a snapshot in time of parts of sharding state. &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/query/sbe_stage_builder.cpp#L2717-L2727&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;SBE plans make an owned ShardFilterer if needed&lt;/a&gt;, and currently the ShardFilterer will be stored together with the SBE plan in the SBE plan cache. Next time when the cached SBE plan is recovered from the cache we could end up using a stale ShardFilterer.&#160; This ticket is to investigate whether we should or should not store the ShardFilterer in the SBE plan cache.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1940536">SERVER-61835</key>
            <summary>Fix how SBE plan cache deals with ShardFilterer</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="ruoxin.xu@mongodb.com">Ruoxin Xu</assignee>
                                    <reporter username="ruoxin.xu@mongodb.com">Ruoxin Xu</reporter>
                        <labels>
                    </labels>
                <created>Wed, 1 Dec 2021 15:28:16 +0000</created>
                <updated>Wed, 10 Jan 2024 18:11:33 +0000</updated>
                            <resolved>Tue, 15 Feb 2022 09:09:45 +0000</resolved>
                                                    <fixVersion>5.3.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="4354086" author="xgen-internal-githook" created="Mon, 14 Feb 2022 18:11:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Ruoxin Xu&apos;, &apos;email&apos;: &apos;ruoxin.xu@mongodb.com&apos;, &apos;username&apos;: &apos;RuoxinXu&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61835&quot; title=&quot;Fix how SBE plan cache deals with ShardFilterer&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61835&quot;&gt;&lt;del&gt;SERVER-61835&lt;/del&gt;&lt;/a&gt; Fix how SBE plan cache deals with ShardFilterer&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/7a1ecab0a42ce278d592fc274d59cbe09af2caaf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/7a1ecab0a42ce278d592fc274d59cbe09af2caaf&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4226973" author="anton.korshunov" created="Thu, 2 Dec 2021 15:30:45 +0000"  >&lt;p&gt;Good call, Ian, yes, we will need to encode the read concern into a plan cache key.&lt;/p&gt;</comment>
                            <comment id="4225947" author="ian.boros" created="Thu, 2 Dec 2021 01:06:05 +0000"  >&lt;p&gt;Another thought I had while reading this, do we account for the read concern in the cache key? If you read with level &quot;available,&quot; we don&apos;t do shard filtering. So, if you run a query at &quot;available&quot; read concern, we cache that plan and then, a query of the same shape is run with a stronger read concern, is it possible we&apos;d incorrectly use that same plan without the shard filter?&lt;/p&gt;</comment>
                            <comment id="4224870" author="anton.korshunov" created="Wed, 1 Dec 2021 17:48:00 +0000"  >&lt;p&gt;Once plan execution is over the SBE plan will be destroyed releasing all allocated resources, so this shouldn&apos;t be an issue.&lt;/p&gt;</comment>
                            <comment id="4224848" author="kaloian.manassiev" created="Wed, 1 Dec 2021 17:42:12 +0000"  >&lt;blockquote&gt;&lt;p&gt;... re-acquiring a ShardFilterer and resetting it on the recovered cached plan before we start executing it&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This sounds like it is more catered towards the first problem that I described above (that the ownership is dynamic and can change). However it will not solve the second problem, which is that range deleter will still be blocked for time proportional to when the next time a plan will be used. Am I understanding it correctly?&lt;/p&gt;</comment>
                            <comment id="4224835" author="anton.korshunov" created="Wed, 1 Dec 2021 17:39:04 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kaloian.manassiev&quot; class=&quot;user-hover&quot; rel=&quot;kaloian.manassiev&quot;&gt;kaloian.manassiev&lt;/a&gt; &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jordi.serra-torrens&quot; class=&quot;user-hover&quot; rel=&quot;jordi.serra-torrens&quot;&gt;jordi.serra-torrens&lt;/a&gt; Thanks for your insights, this is very helpful indeed. We have an idea and a draft patch of how this issue can be solved by re-acquiring a &lt;tt&gt;ShardFilterer&lt;/tt&gt; and resetting it on the recovered cached plan before we start executing it, so hopefully this will address your concerns. CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=david.storch&quot; class=&quot;user-hover&quot; rel=&quot;david.storch&quot;&gt;david.storch&lt;/a&gt; we may need to prioritize this work after the plan recovery PR gets landed.&lt;/p&gt;</comment>
                            <comment id="4224798" author="JIRAUSER1257318" created="Wed, 1 Dec 2021 17:30:57 +0000"  >&lt;blockquote&gt;&lt;p&gt;Second, holding the filter open blocks range deletion which means that orphan documents will accumulate indefinitely.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;I encountered this problem while working on &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-43099&quot; title=&quot;Reenable random chunk migration failpoint for concurrency with_balancer suites&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-43099&quot;&gt;&lt;del&gt;SERVER-43099&lt;/del&gt;&lt;/a&gt;. More precisely on the drop_index_during_replan.js workload, which would get blocked on the fixture teardown while waiting for the orphans to be cleaned up. Here&apos;s a simple test I wrote to demonstrate this. It fails when featureFlagSbePlanCache is enabled.&lt;br/&gt;
 &lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/attachment/348680/348680_sbe_plan_cache_blocks_range_deletion.patch&quot; title=&quot;sbe_plan_cache_blocks_range_deletion.patch attached to SERVER-61835&quot;&gt;sbe_plan_cache_blocks_range_deletion.patch&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://jira.mongodb.org/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;./buildscripts/resmoke.py run --storageEngine=wiredTiger --storageEngineCacheSizeGB=.50 --suite=sharding jstests/sharding/sbe_plan_cache_blocks_range_deletion.js --additionalFeatureFlags=featureFlagSbePlanCache --log=file&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
</comment>
                            <comment id="4224630" author="kaloian.manassiev" created="Wed, 1 Dec 2021 16:42:05 +0000"  >&lt;p&gt;If the shard filtering logic is being cached as part of the plan this sounds very wrong, on multiple levels: First of all, the ownership of a shard can change while operations are executing and newer queries should be able to use the most up-to-date filter in order to see the newest changes; Second, holding the filter open blocks range deletion which means that orphan documents will accumulate indefinitely.&lt;/p&gt;

&lt;p&gt;CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jordi.serra-torrens&quot; class=&quot;user-hover&quot; rel=&quot;jordi.serra-torrens&quot;&gt;jordi.serra-torrens&lt;/a&gt;&#160;who I believe hit that problem in testing.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="1933550">SERVER-61737</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="913256">SERVER-43099</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2539729">SERVER-84644</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2237075">SERVER-73032</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="348680" name="sbe_plan_cache_blocks_range_deletion.patch" size="1315" author="jordi.serra-torrens@mongodb.com" created="Wed, 1 Dec 2021 17:30:34 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8.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_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>Wed, 1 Dec 2021 16:42:05 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 51 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-61737'>SERVER-61737</a></s>]]></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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-2371</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>william.qian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 51 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>anton.korshunov@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>ian.boros@mongodb.com</customfieldvalue>
            <customfieldvalue>jordi.serra-torrens@mongodb.com</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>ruoxin.xu@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0cvhr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr2mg7:</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="5280">QO 2022-01-10</customfieldvalue>
    <customfieldvalue id="5282">QO 2022-01-24</customfieldvalue>
    <customfieldvalue id="5284">QO 2022-02-07</customfieldvalue>
    <customfieldvalue id="5286">QO 2022-02-21</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|i0chn3:</customfieldvalue>

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