<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:44:35 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-36966] Sharded map reduce may fail to clean up temporary output collection</title>
                <link>https://jira.mongodb.org/browse/SERVER-36966</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/2704d7a89e64167fcff7356ada111b313146474e/src/mongo/s/commands/cluster_map_reduce_cmd.cpp#L614&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;This call&lt;/a&gt; is supposed to drop the temporary output collections if anything goes wrong in the command, but in some cases we don&apos;t reach there. In particular, I&apos;ve reproduced a failure where &lt;a href=&quot;https://github.com/mongodb/mongo/blob/2704d7a89e64167fcff7356ada111b313146474e/src/mongo/s/commands/cluster_map_reduce_cmd.cpp#L453&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this line&lt;/a&gt; can throw an exception due to a stale config. When that happens, the cleanup code doesn&apos;t run and the collection is left around. &lt;/p&gt;

&lt;p&gt;To fix this, we should use a ScopeGuard to make sure we clean up the temporary collections if we exit the function due to an exception.&lt;/p&gt;</description>
                <environment></environment>
        <key id="598209">SERVER-36966</key>
            <summary>Sharded map reduce may fail to clean up temporary output collection</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="13201">Fixed</resolution>
                                        <assignee username="charlie.swanson@mongodb.com">Charlie Swanson</assignee>
                                    <reporter username="charlie.swanson@mongodb.com">Charlie Swanson</reporter>
                        <labels>
                            <label>todo_in_code</label>
                    </labels>
                <created>Fri, 31 Aug 2018 19:56:37 +0000</created>
                <updated>Sun, 29 Oct 2023 22:28:29 +0000</updated>
                            <resolved>Mon, 5 Nov 2018 14:09:34 +0000</resolved>
                                                    <fixVersion>4.0.5</fixVersion>
                    <fixVersion>4.1.5</fixVersion>
                                    <component>MapReduce</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2519298" author="xgen-internal-githook" created="Wed, 6 Nov 2019 02:43:30 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;cswanson310&apos;, &apos;email&apos;: &apos;charlie.swanson@mongodb.com&apos;, &apos;name&apos;: &apos;Charlie Swanson&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44211&quot; title=&quot;Complete TODO listed in SERVER-36966&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44211&quot;&gt;&lt;del&gt;SERVER-44211&lt;/del&gt;&lt;/a&gt; Unblacklist tests now that &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36966&quot; title=&quot;Sharded map reduce may fail to clean up temporary output collection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36966&quot;&gt;&lt;del&gt;SERVER-36966&lt;/del&gt;&lt;/a&gt; is done&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5cb4b0a1cc7a60d6cea01e551aa0f5e5f6e823b4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5cb4b0a1cc7a60d6cea01e551aa0f5e5f6e823b4&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2066217" author="xgen-internal-githook" created="Mon, 19 Nov 2018 14:48:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Charlie Swanson&apos;, &apos;email&apos;: &apos;charlie.swanson@mongodb.com&apos;, &apos;username&apos;: &apos;cswanson310&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36966&quot; title=&quot;Sharded map reduce may fail to clean up temporary output collection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36966&quot;&gt;&lt;del&gt;SERVER-36966&lt;/del&gt;&lt;/a&gt; Validate ns in cluster mapReduce&lt;/p&gt;

&lt;p&gt;Also ensures that the temp collections are always up to date, and&lt;br/&gt;
extends the passthrough coverage of the mapReduce command outputting to&lt;br/&gt;
a sharded collection.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 7dbcd710077bc4141e71730be9e12558880375e6)&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/794e75a24d975f80317cf92c004cf5cb9ea5b03d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/794e75a24d975f80317cf92c004cf5cb9ea5b03d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2051551" author="xgen-internal-githook" created="Mon, 5 Nov 2018 14:09:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Charlie Swanson&apos;, &apos;email&apos;: &apos;charlie.swanson@mongodb.com&apos;, &apos;username&apos;: &apos;cswanson310&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-36966&quot; title=&quot;Sharded map reduce may fail to clean up temporary output collection&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-36966&quot;&gt;&lt;del&gt;SERVER-36966&lt;/del&gt;&lt;/a&gt; Validate ns in cluster mapReduce&lt;/p&gt;

&lt;p&gt;Also ensures that the temp collections are always up to date, and&lt;br/&gt;
extends the passthrough coverage of the mapReduce command outputting to&lt;br/&gt;
a sharded collection.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/7dbcd710077bc4141e71730be9e12558880375e6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/7dbcd710077bc4141e71730be9e12558880375e6&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2024912" author="charlie.swanson" created="Fri, 5 Oct 2018 13:24:45 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=blake.oler&quot; class=&quot;user-hover&quot; rel=&quot;blake.oler&quot;&gt;blake.oler&lt;/a&gt; sure, I&apos;d be happy to!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=greg.mckeon&quot; class=&quot;user-hover&quot; rel=&quot;greg.mckeon&quot;&gt;greg.mckeon&lt;/a&gt; can you clarify why this was bumped into a sprint? I was treating this as a BF friday ticket since it is blocking a BF. The workflow for those tickets is no longer to drag them into the sprint.&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="2021378" author="blake.oler" created="Tue, 2 Oct 2018 21:50:04 +0000"  >&lt;p&gt;I will be adding temporary blacklists for this test as part of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-37330&quot; title=&quot;Add sharded passthrough suites to detect errors in LogicalSessionCache&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-37330&quot;&gt;&lt;del&gt;SERVER-37330&lt;/del&gt;&lt;/a&gt; (running into this failure frequently). As part of the fix for this ticket, could you remove those blacklists? &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=charlie.swanson&quot; class=&quot;user-hover&quot; rel=&quot;charlie.swanson&quot;&gt;charlie.swanson&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2011875" author="charlie.swanson" created="Mon, 24 Sep 2018 14:22:00 +0000"  >&lt;p&gt;&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; yes, but I need to put up a further patch with the steps outlined above. &lt;/p&gt;</comment>
                            <comment id="2011848" author="david.storch" created="Mon, 24 Sep 2018 14:07:37 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=charlie.swanson&quot; class=&quot;user-hover&quot; rel=&quot;charlie.swanson&quot;&gt;charlie.swanson&lt;/a&gt;, is the code review for this ticket still active?&lt;/p&gt;</comment>
                            <comment id="2011064" author="charlie.swanson" created="Fri, 21 Sep 2018 21:58:38 +0000"  >&lt;p&gt;Investigated more and talked to Esha - we think there are two bugs in map reduce:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Should it encounter a stale shard version, it leaves around a temp collection - this is what we thought the original bug was.&lt;/li&gt;
	&lt;li&gt;It doesn&apos;t correctly enforce that the collection being output to doesn&apos;t already exist. We think that if someone issues a map reduce with the syntax {{
{out: &quot;collection&quot;}
&lt;p&gt;}}, that map reduce should fail if &quot;collection&quot; already exists and is sharded. Instead, the user should specify {&lt;tt&gt;out: {replace: &quot;collection&quot;, sharded: true&lt;/tt&gt;}}.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;We think we know how to fix this, but I didn&apos;t get enough time to implement the fix. We should&lt;br/&gt;
1) enforce the collection doesn&apos;t already exist in this scenario&lt;br/&gt;
2) add an ON_BLOCK_EXIT to clean up the temp collections should anything throw an exception&lt;br/&gt;
3) update tests in jstests/core to account for this - some will start failing due to #1. One idea which we want to explore is changing the shell&apos;s mapReduce helper to automatically adjust the syntax used in the &quot;implicitly sharded collections&quot; passthrough.&lt;/p&gt;</comment>
                            <comment id="2009286" author="ian@10gen.com" created="Thu, 20 Sep 2018 15:40:21 +0000"  >&lt;p&gt;Next step is still for Charlie to talk to Esha.&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">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="935586">SERVER-43477</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="978506">SERVER-44211</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>9.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="15640"><![CDATA[v4.0]]></customfieldvalue>
    <customfieldvalue key="15141"><![CDATA[v3.6]]></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>Thu, 20 Sep 2018 15:40:21 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 14 weeks, 1 day 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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 14 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14.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>blake.oler@mongodb.com</customfieldvalue>
            <customfieldvalue>charlie.swanson@mongodb.com</customfieldvalue>
            <customfieldvalue>david.storch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>ian@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu6ww7:</customfieldvalue>

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

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