<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:04:56 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-66270] ExpressionContext::inMongos does not reliably reflect the execution context</title>
                <link>https://jira.mongodb.org/browse/SERVER-66270</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When creating an &lt;tt&gt;ExpressionContext&lt;/tt&gt; within &lt;tt&gt;ClusterAggregate::runAggregate&lt;/tt&gt;, we &lt;a href=&quot;https://github.com/mongodb/mongo/blob/f812c3bc873762960f32dbb64de1acb0e0133f01/src/mongo/s/query/cluster_aggregate.cpp#L134&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;unconditionally set the &lt;tt&gt;inMongos&lt;/tt&gt; field to &lt;tt&gt;true&lt;/tt&gt;&lt;/a&gt;. We do this because, at the time this code was written, &lt;tt&gt;ClusterAggregate&lt;/tt&gt; was only linked into and available on &lt;tt&gt;mongoS&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;However, this appears to have changed as a result of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45389&quot; title=&quot;Add metrics tracking how often shards have inconsistent indexes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45389&quot;&gt;&lt;del&gt;SERVER-45389&lt;/del&gt;&lt;/a&gt;. After this point, &lt;tt&gt;ClusterAggregate&lt;/tt&gt; is &lt;a href=&quot;https://github.com/mongodb/mongo/commit/ea696eb7a27f18c21223a3ff94d9124f06698af5#diff-706de6fd8e6f478748408ea5e5b860b3f6af6c6b932d38fb415afa2d4e182cb5R95&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;linked into &lt;tt&gt;mongod&lt;/tt&gt;&lt;/a&gt; and is &lt;a href=&quot;https://github.com/mongodb/mongo/commit/ea696eb7a27f18c21223a3ff94d9124f06698af5#diff-55ce7f41ac709f63a370d207357a4d96c193364842c76667c3a0b7565050a475R127&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;used by the &lt;tt&gt;PeriodicShardedIndexConsistencyChecker&lt;/tt&gt;&lt;/a&gt;, which runs on the config server primary.&lt;/p&gt;

&lt;p&gt;Since &lt;tt&gt;ClusterAggregate&lt;/tt&gt; no longer exclusively runs on &lt;tt&gt;mongoS&lt;/tt&gt;, we need a more robust means of setting &lt;tt&gt;inMongos&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;We should also investigate whether &lt;tt&gt;ExpressionContext::fromMongos&lt;/tt&gt; reliably reflects the execution context.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2040864">SERVER-66270</key>
            <summary>ExpressionContext::inMongos does not reliably reflect the execution context</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="1" iconUrl="https://jira.mongodb.org/images/icons/statuses/open.png" description="">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-query-execution">Backlog - Query Execution</assignee>
                                    <reporter username="bernard.gorman@mongodb.com">Bernard Gorman</reporter>
                        <labels>
                            <label>auto-reverted</label>
                    </labels>
                <created>Thu, 5 May 2022 23:37:09 +0000</created>
                <updated>Mon, 6 Mar 2023 15:45:53 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="4534578" author="bernard.gorman" created="Mon, 9 May 2022 10:36:10 +0000"  >&lt;p&gt;For context: we found that fixing the &lt;tt&gt;inMongos&lt;/tt&gt; parameter such that it accurately reflected whether or not we were executing on mongoS caused the &lt;tt&gt;PeriodicShardedIndexConsistencyChecker&lt;/tt&gt; to fail. This is because the value of &lt;tt&gt;fromMongos&lt;/tt&gt; in the &lt;tt&gt;aggregate&lt;/tt&gt; command sent to the shards depends on &lt;tt&gt;inMongos&lt;/tt&gt;, and if &lt;tt&gt;fromMongos&lt;/tt&gt; is &lt;tt&gt;false&lt;/tt&gt; then the shards do not include the &lt;tt&gt;shard&lt;/tt&gt; field in the output of the &lt;tt&gt;$indexStats&lt;/tt&gt; stage at the start of the &lt;tt&gt;PeriodicShardedIndexConsistencyChecker&lt;/tt&gt; pipeline, which causes the pipeline&apos;s subsequent grouping logic to fail.&lt;/p&gt;

&lt;p&gt;We may want to revisit our reliance on &lt;tt&gt;fromMongos&lt;/tt&gt; when deciding whether to output the &lt;tt&gt;shard&lt;/tt&gt; field in the &lt;tt&gt;$indexStats&lt;/tt&gt; stage (and others, such as &lt;tt&gt;$currentOp&lt;/tt&gt;, where the same approach is used).&lt;/p&gt;</comment>
                            <comment id="4533237" author="xgen-buildbaron-user" created="Sat, 7 May 2022 16:10:19 +0000"  >&lt;p&gt;Ticket re-opened due to revert. &lt;a href=&quot;https://evergreen.mongodb.com/task/mongodb_mongo_master_enterprise_windows_required_display_noPassthrough_4170c36e4d2551a0f5e7044c63ee9b8a2a5b48b5_22_05_07_00_58_21&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;noPassthrough&lt;/a&gt; began a consistent failure of jstests\noPassthrough\sharded_index_consistency_metrics.js,jstests\noPassthrough\sharded_index_consistency_metrics_stale_version_retries.js&lt;/p&gt;</comment>
                            <comment id="4533236" author="xgen-internal-githook" created="Sat, 7 May 2022 16:08:34 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;auto-revert-processor&apos;, &apos;email&apos;: &apos;dev-prod-dag@mongodb.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-66270&quot; title=&quot;ExpressionContext::inMongos does not reliably reflect the execution context&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-66270&quot;&gt;SERVER-66270&lt;/a&gt; Set ExpressionContext::inMongos to true only on mongos&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 4170c36e4d2551a0f5e7044c63ee9b8a2a5b48b5.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/8cc33764380e07c6d2430c45e859ba9eacead4cc&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/8cc33764380e07c6d2430c45e859ba9eacead4cc&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4532867" author="xgen-internal-githook" created="Sat, 7 May 2022 00:58:31 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Arun Banala&apos;, &apos;email&apos;: &apos;arun.banala@mongodb.com&apos;, &apos;username&apos;: &apos;banarun&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-66270&quot; title=&quot;ExpressionContext::inMongos does not reliably reflect the execution context&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-66270&quot;&gt;SERVER-66270&lt;/a&gt; Set ExpressionContext::inMongos to true only on mongos&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/4170c36e4d2551a0f5e7044c63ee9b8a2a5b48b5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/4170c36e4d2551a0f5e7044c63ee9b8a2a5b48b5&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2041508">SERVER-66295</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2042189">SERVER-66307</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2259207">SERVER-73832</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2040870">SERVER-66271</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.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_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="24444"><![CDATA[v6.1]]></customfieldvalue>
    <customfieldvalue key="23470"><![CDATA[v6.0]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 6 May 2022 18:09:48 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        1 year, 39 weeks, 2 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1951</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>bernard.gorman@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            1 year, 39 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>173.0</customfieldvalue>

                        </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>backlog-query-execution</customfieldvalue>
            <customfieldvalue>bernard.gorman@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>Xgen-BuildBaron-User</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0tvzr:</customfieldvalue>

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

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