<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:11:08 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>[DOCS-14763] $sample aggregation pipeline incorrectly warns &quot;$sample may output the same document more than once in its result set.&quot;</title>
                <link>https://jira.mongodb.org/browse/DOCS-14763</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;p&gt;The &lt;a href=&quot;https://docs.mongodb.com/manual/reference/operator/aggregation/sample/#behavior&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;documentation&lt;/a&gt; for the $sample aggregation pipeline warns:&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;$sample may output the same document more than once in its result set.&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;It appears this warning may be residual from &lt;a href=&quot;https://docs.mongodb.com/v3.2/reference/operator/aggregation/sample/#behavior&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the introduction of the feature in 3.2&lt;/a&gt;, where duplicates were possible when using MMAPv1.  When using WiredTiger, there are two methods for $sample to obtain random documents.&lt;/p&gt;

&lt;p&gt;The first of which uses a pseudo-random cursor to select documents, which has &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c64f66f267f1af919f323a0d7a32292a9a0965d1/src/mongo/db/pipeline/document_source_sample_from_random_cursor.cpp#L103-L106&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;a means to prevent duplicates from being returned&lt;/a&gt;, and will error if it falls short of accomplishing deduplication.&lt;/p&gt;

&lt;p&gt;The second method will perform a collection scan by _id, which should never return duplicates when WiredTiger is employed but may have resulted in duplicates with MMAPv1.&lt;/p&gt;

&lt;p&gt;My understanding is that the warning should only be applicable when MMAPv1 was potentially in use as the storage engine, as neither method used by $sample to obtain random documents will return duplicates when WiredTiger is in use.&lt;/p&gt;

&lt;p&gt;As it stands now, this warning may (unnecessarily) prevent this feature from being considered for a number of use cases.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1861074">DOCS-14763</key>
            <summary>$sample aggregation pipeline incorrectly warns &quot;$sample may output the same document more than once in its result set.&quot;</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="jeffrey.allen@mongodb.com">Jeffrey Allen</assignee>
                                    <reporter username="dave.walker@mongodb.com">David Walker</reporter>
                        <labels>
                            <label>aggregation-framework</label>
                    </labels>
                <created>Thu, 26 Aug 2021 20:19:07 +0000</created>
                <updated>Mon, 30 Oct 2023 20:01:53 +0000</updated>
                            <resolved>Wed, 13 Oct 2021 16:17:21 +0000</resolved>
                                                    <fixVersion>Server_Docs_20231030</fixVersion>
                                    <component>manual</component>
                    <component>Server</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="4121949" author="xgen-internal-githook" created="Wed, 13 Oct 2021 16:20:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jeff Allen&apos;, &apos;email&apos;: &apos;jeffrey.allen@10gen.com&apos;, &apos;username&apos;: &apos;jeff-allen-mongo&apos;}
&lt;p&gt;Message: (&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-14763&quot; title=&quot;$sample aggregation pipeline incorrectly warns &amp;quot;$sample may output the same document more than once in its result set.&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-14763&quot;&gt;&lt;del&gt;DOCS-14763&lt;/del&gt;&lt;/a&gt;): Clarify sample agg behavior warning&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/4d24ffc5da45d367076e32608a2a54f82698df47&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/4d24ffc5da45d367076e32608a2a54f82698df47&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4121947" author="xgen-internal-githook" created="Wed, 13 Oct 2021 16:20:08 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jeff Allen&apos;, &apos;email&apos;: &apos;jeffrey.allen@10gen.com&apos;, &apos;username&apos;: &apos;jeff-allen-mongo&apos;}
&lt;p&gt;Message: (&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-14763&quot; title=&quot;$sample aggregation pipeline incorrectly warns &amp;quot;$sample may output the same document more than once in its result set.&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-14763&quot;&gt;&lt;del&gt;DOCS-14763&lt;/del&gt;&lt;/a&gt;): Clarify sample agg behavior warning&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/9df4c43c080f0f535db330a7f0f5076c3d5ac33f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/9df4c43c080f0f535db330a7f0f5076c3d5ac33f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4121946" author="xgen-internal-githook" created="Wed, 13 Oct 2021 16:19:38 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jeff Allen&apos;, &apos;email&apos;: &apos;jeffrey.allen@10gen.com&apos;, &apos;username&apos;: &apos;jeff-allen-mongo&apos;}
&lt;p&gt;Message: (&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-14763&quot; title=&quot;$sample aggregation pipeline incorrectly warns &amp;quot;$sample may output the same document more than once in its result set.&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-14763&quot;&gt;&lt;del&gt;DOCS-14763&lt;/del&gt;&lt;/a&gt;): Clarify sample agg behavior warning&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/e0b39e9190f7810eff387e2e52606a89b188c013&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/e0b39e9190f7810eff387e2e52606a89b188c013&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4121939" author="xgen-internal-githook" created="Wed, 13 Oct 2021 16:17:55 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jeff Allen&apos;, &apos;email&apos;: &apos;jeffrey.allen@10gen.com&apos;, &apos;username&apos;: &apos;jeff-allen-mongo&apos;}
&lt;p&gt;Message: (&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-14763&quot; title=&quot;$sample aggregation pipeline incorrectly warns &amp;quot;$sample may output the same document more than once in its result set.&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-14763&quot;&gt;&lt;del&gt;DOCS-14763&lt;/del&gt;&lt;/a&gt;): Clarify sample agg behavior warning&lt;br/&gt;
Branch: v5.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/dcbe816a7a40346d9233f54e47bfc422fd5cd76f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/dcbe816a7a40346d9233f54e47bfc422fd5cd76f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4121932" author="xgen-internal-githook" created="Wed, 13 Oct 2021 16:16:57 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Jeff Allen&apos;, &apos;email&apos;: &apos;jeffrey.allen@10gen.com&apos;, &apos;username&apos;: &apos;jeff-allen-mongo&apos;}
&lt;p&gt;Message: (&lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-14763&quot; title=&quot;$sample aggregation pipeline incorrectly warns &amp;quot;$sample may output the same document more than once in its result set.&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-14763&quot;&gt;&lt;del&gt;DOCS-14763&lt;/del&gt;&lt;/a&gt;): Clarify sample agg behavior warning&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/e65601ed005526a554aa08d8aa74ea6f1eddbde4&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/e65601ed005526a554aa08d8aa74ea6f1eddbde4&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>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 1 Sep 2021 16:57:38 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 17 weeks 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>DOCSP-11701</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_14873" key="com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker">
                        <customfieldname>External Reviewer</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[dave.walker@mongodb.com]]></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>emet.ozar@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 17 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>dave.walker@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>jeffrey.allen@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzzdmv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzje1z:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="5439">ServerDocs2021: Aug31 - Sep07</customfieldvalue>
    <customfieldvalue id="5445">ServerDocs2021: Sep07 - Sep14</customfieldvalue>
    <customfieldvalue id="5455">ServerDocs2021: Sep14 - Sep21</customfieldvalue>
    <customfieldvalue id="5485">ServerDocs2021: Sep21 - Sep28</customfieldvalue>
    <customfieldvalue id="5497">ServerDocs2021: Sep28 - Oct5</customfieldvalue>
    <customfieldvalue id="5504">ServerDocs2021: Oct5 - Oct12</customfieldvalue>
    <customfieldvalue id="5505">ServerDocs2021: Oct12 - Oct19</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</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_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzyzvr:</customfieldvalue>

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