<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:07:41 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-45032] Allow $planCacheStats to target every shardsvr node in a sharded cluster</title>
                <link>https://jira.mongodb.org/browse/SERVER-45032</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44823&quot; title=&quot;Sharding support for $planCacheStats&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44823&quot;&gt;&lt;del&gt;SERVER-44823&lt;/del&gt;&lt;/a&gt;, we improved &lt;a href=&quot;https://docs.mongodb.com/manual/reference/operator/aggregation/planCacheStats/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;$planCacheStats&lt;/a&gt; to be able to gather plan cache metadata from all of the shards in a sharded cluster. However, this operation uses the normal host targeting rules for selecting a single node in each shard. Unlike regular data, the plan cache metadata is not replicated and is local to each node. Rather than choose a single node from each shard, &lt;tt&gt;$planCacheStats&lt;/tt&gt; should be capable of targeting every data-bearing node in the cluster&#8212;that is, every node in every shard, excluding the config servers. &lt;/p&gt;

&lt;p&gt;Achieving this behavior may require some work in the underlying sharding infrastructure, since I&apos;m not aware of any other pre-existing sharded operation that targets every node in the cluster. Also, this could be a very expensive operation for large sharded clusters, so we should consider having users opt into this behavior explicitly, perhaps with a new &lt;a href=&quot;https://docs.mongodb.com/manual/core/read-preference/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;readPreference&lt;/a&gt; setting or with an explicit flag on the &lt;tt&gt;$planCacheStats&lt;/tt&gt; operation.&lt;/p&gt;

&lt;p&gt;Note that &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-34633&quot; title=&quot;Allow $currentOp to retrieve operations from all members of each shard in a cluster&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-34633&quot;&gt;&lt;del&gt;SERVER-34633&lt;/del&gt;&lt;/a&gt; tracks a very similar improvement for the &lt;a href=&quot;https://docs.mongodb.com/manual/reference/operator/aggregation/currentOp/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;$currentOp&lt;/a&gt; agg stage.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1044576">SERVER-45032</key>
            <summary>Allow $planCacheStats to target every shardsvr node in a sharded cluster</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="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="ivan.fefer@mongodb.com">Ivan Fefer</assignee>
                                    <reporter username="david.storch@mongodb.com">David Storch</reporter>
                        <labels>
                            <label>qexec-team</label>
                    </labels>
                <created>Mon, 9 Dec 2019 21:19:29 +0000</created>
                <updated>Sun, 29 Oct 2023 22:14:16 +0000</updated>
                            <resolved>Wed, 19 Apr 2023 10:20:56 +0000</resolved>
                                                    <fixVersion>7.1.0-rc0</fixVersion>
                                    <component>Aggregation Framework</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="5358286" author="xgen-internal-githook" created="Wed, 19 Apr 2023 09:45:58 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Ivan Fefer&apos;, &apos;email&apos;: &apos;ivan.fefer@mongodb.com&apos;, &apos;username&apos;: &apos;Fefer-Ivan&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45032&quot; title=&quot;Allow $planCacheStats to target every shardsvr node in a sharded cluster&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45032&quot;&gt;&lt;del&gt;SERVER-45032&lt;/del&gt;&lt;/a&gt; Add allHosts option to $planCacheStats to get info from all hosts in a shard&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/6fba90220e41744b65979950c01dea69fe39bb7c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/6fba90220e41744b65979950c01dea69fe39bb7c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5347149" author="milkie" created="Fri, 14 Apr 2023 11:19:52 +0000"  >&lt;p&gt;And yes, I think the only way to implement this for every node in a sharded cluster would be to implement it for replica sets. This will become moot once we make all replica sets single shards, anyway. &lt;/p&gt;</comment>
                            <comment id="5347145" author="milkie" created="Fri, 14 Apr 2023 11:17:50 +0000"  >&lt;p&gt;Actually I think that section of the docs is a disclaimer, warning users about an unexpected behavior. &lt;br/&gt;
In practice, it would be difficult and cumbersome to fetch the cache stats from every node just using read preference and replica set tags. &lt;/p&gt;</comment>
                            <comment id="5347074" author="JIRAUSER1270969" created="Fri, 14 Apr 2023 10:45:48 +0000"  >&lt;p&gt;In docs we state that users should use readPreference to get plan cache from different parts of replica set: &lt;a href=&quot;https://www.mongodb.com/docs/manual/reference/operator/aggregation/planCacheStats/#read-preference&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://www.mongodb.com/docs/manual/reference/operator/aggregation/planCacheStats/#read-preference&lt;/a&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="5347056" author="JIRAUSER1270969" created="Fri, 14 Apr 2023 10:34:06 +0000"  >&lt;p&gt;Should this ticket also affect $planCacheStats for replica sets?&lt;/p&gt;</comment>
                            <comment id="5187078" author="davis.haupt" created="Fri, 10 Feb 2023 16:39:40 +0000"  >&lt;p&gt;Flagging for scheduling because after &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-73557&quot; title=&quot;Add ability for mongos to broadcast the shards part of a pipeline to all primaries and secondaries in a cluster&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-73557&quot;&gt;&lt;del&gt;SERVER-73557&lt;/del&gt;&lt;/a&gt; completed, this will likely be a good quick win nomination.&lt;/p&gt;</comment>
                            <comment id="4737614" author="milkie" created="Tue, 9 Aug 2022 14:12:32 +0000"  >&lt;p&gt;Note that $indexStats has the same issue and could benefit from this work as well.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="2251049">SERVER-73557</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2318341">COMPASS-6739</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10320">
                    <name>Documented</name>
                                                                <inwardlinks description="is documented by">
                                        <issuelink>
            <issuekey id="2318339">DOCS-16051</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1485330">SERVER-51117</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1106624">SERVER-45658</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="533162">SERVER-34633</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1024194">SERVER-44823</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_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_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>Tue, 9 Aug 2022 14:12:32 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        42 weeks 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-73557'>SERVER-73557</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_17052" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Downstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>$planCacheStats aggregation stage has new parameter: allHosts.&lt;br/&gt;
Default value: false.&lt;br/&gt;
&lt;br/&gt;
When allHosts is false, $planCacheStats behaves as it used to. It follows read preference and will retrieve plan cache data from only targeted replica set node.&lt;br/&gt;
We have this documented here: &lt;a href=&quot;https://www.mongodb.com/docs/manual/reference/operator/aggregation/planCacheStats/#read-preference&quot;&gt;https://www.mongodb.com/docs/manual/reference/operator/aggregation/planCacheStats/#read-preference&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
Setting allHosts to true only supported in sharded clusters. If {$planCacheStats: {allHosts: true}} will be called on standalone or bare replica set, error will be returned during pipeline parsing:&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/pipeline/document_source_plan_cache_stats.cpp#L64&quot;&gt;https://github.com/mongodb/mongo/blob/master/src/mongo/db/pipeline/document_source_plan_cache_stats.cpp#L64&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
When allHosts is true mongos will broadcast $planCacheStats to all nodes, primary and secondaries, for each affected shard (every shard that have at least one chunk from target collection).&lt;br/&gt;
&lt;br/&gt;
It only works on sharded clusters, because on bare replica set there is no simple way to broadcast queries and then merge cursors. This should change in 8.0.&lt;br/&gt;
&lt;br/&gt;
For mongosh it may make sense to add options argument to PlanCache.list() function.</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-3063</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>
                            42 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>davis.haupt@mongodb.com</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>ivan.fefer@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hw9h9r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr2h9z:</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_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></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>
    <customfieldvalue key="16945"><![CDATA[Drivers]]></customfieldvalue>
    <customfieldvalue key="20960"><![CDATA[DBX: DevTools (Compass, Shell, VS Code Ext)]]></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|hw93j3:</customfieldvalue>

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