<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:52:58 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-61648] $group with $avg in $lookup inner pipeline fails</title>
                <link>https://jira.mongodb.org/browse/SERVER-61648</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;jstests/sharding/query/sharded_lookup_execution.js fails with an&#160;assertion in src/mongo/db/pipeline/accumulator_avg.cpp:62 executing this pipeline (see &quot;assertLookupExecution(pipeline, {comment: &quot;unsharded_to_sharded_cache&quot;}&quot; at sharded_lookup_execution.js:632):&lt;br/&gt;
 [[ {&quot;$match&quot; : {&quot;customer&quot; : &quot;Alice&quot;}}, {&quot;$unwind&quot; : &quot;$products&quot;}, { &quot;$lookup&quot; : { &quot;from&quot; : &quot;reviews&quot;, &quot;let&quot; :&lt;/p&gt;

{&quot;customer_product_name&quot; : &quot;$products._id&quot;}

&lt;p&gt;, &quot;pipeline&quot; : [ { &quot;$group&quot; : { &quot;_id&quot; : &quot;$product_id&quot;, &quot;avg_stars&quot; :&lt;/p&gt;

{ &quot;$avg&quot; : &quot;$stars&quot; }

&lt;p&gt;, &quot;name&quot; : { &quot;$first&quot; : &quot;$product_id&quot; } } }, {&quot;$match&quot; : {&quot;$expr&quot; :&lt;/p&gt;

{&quot;$eq&quot; : [&quot;$name&quot;,&quot;$$customer_product_name&quot;]}

&lt;p&gt;}} ], &quot;as&quot; : &quot;avg_review&quot; } }, {&quot;$unwind&quot; : {&quot;path&quot; : &quot;$avg_review&quot;, &quot;preserveNullAndEmptyArrays&quot; : true}}, {&quot;$group&quot; : {&quot;_id&quot; : &quot;$_id&quot;, &quot;products&quot; : {&quot;$push&quot; : {&quot;_id&quot; : &quot;$products._id&quot;,&quot;avg_review&quot; : &quot;$avg_review.avg_stars&quot;}}}}]&lt;br/&gt;
 &#160;&lt;/p&gt;

&lt;p&gt;The patch: &lt;a href=&quot;https://spruce.mongodb.com/version/61956b90e3c3316cd49b37a4/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://spruce.mongodb.com/version/61956b90e3c3316cd49b37a4/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Log for this failure:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://logkeeper.mongodb.org/lobster/build/1d8dc05c673604aecbc4cec148ef4f4f/test/619577cc54f24805af62463d#bookmarks=0%2C25189&amp;amp;l=1&amp;amp;shareLine=22315&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://logkeeper.mongodb.org/lobster/build/1d8dc05c673604aecbc4cec148ef4f4f/test/619577cc54f24805af62463d#bookmarks=0%2C25189&amp;amp;l=1&amp;amp;shareLine=22315&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1929565">SERVER-61648</key>
            <summary>$group with $avg in $lookup inner pipeline fails</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="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="5">Cannot Reproduce</resolution>
                                        <assignee username="yoonsoo.kim@mongodb.com">Yoon Soo Kim</assignee>
                                    <reporter username="eric.cox@mongodb.com">Eric Cox</reporter>
                        <labels>
                    </labels>
                <created>Fri, 19 Nov 2021 19:25:27 +0000</created>
                <updated>Mon, 22 Nov 2021 22:42:11 +0000</updated>
                            <resolved>Mon, 22 Nov 2021 22:42:11 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4205932" author="JIRAUSER1258488" created="Mon, 22 Nov 2021 20:54:39 +0000"  >&lt;p&gt;The patched build is based on the commit &lt;a href=&quot;https://evergreen.mongodb.com/task/mongodb_mongo_master_enterprise_rhel_80_64_bit_dynamic_all_feature_flags_required_sharding_max_mirroring_0_enterprise_rhel_80_64_bit_dynamic_all_feature_flags_required_73dc221c1d8f6f2b636542b782986e56fdc85879_21_11_17_18_29_12&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;73dc221c1d&lt;/a&gt; and it enabled $avg accumulator for $group pushdown but it didn&apos;t include the sharded $avg logic which is implemented in &lt;a href=&quot;https://github.com/mongodb/mongo/commit/a687be84420c5e8d7ad0ad565baef40b4726e654&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the commit&lt;/a&gt;. So, the $avg is failed in a sharded environment. The issue does not repro anymore after&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/commit/a687be84420c5e8d7ad0ad565baef40b4726e654&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the commit&lt;/a&gt;.&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_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</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>Mon, 22 Nov 2021 20:54:39 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 11 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-2267</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>yoonsoo.kim@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 11 weeks, 2 days ago
                        </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>eric.cox@mongodb.com</customfieldvalue>
            <customfieldvalue>yoonsoo.kim@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0b2f3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr2mhj:</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="5273">QE 2021-11-29</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|i0aokf:</customfieldvalue>

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