<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:09:12 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-13981] Documentation for &quot;nearest&quot; read preference is incorrect</title>
                <link>https://jira.mongodb.org/browse/DOCS-13981</link>
                <project id="10380" key="DOCS">Documentation</project>
                    <description>&lt;h2&gt;&lt;a name=&quot;Description&quot;&gt;&lt;/a&gt;Description&lt;/h2&gt;
&lt;p&gt;The &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;documentation for &quot;nearest&quot; read preference&lt;/a&gt; is incorrect, specifically on this line:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Operations read from the member of the replica set with the least network latency, irrespective of whether that member is a primary or secondary.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This is misleading because it makes it seems like &quot;nearest&quot; will always select the server with the lowest network latency but this is not the case. &quot;Nearest&quot; actually selects a server (primary or secondary) in the localThresholdMS latency window &lt;b&gt;at random&lt;/b&gt;. So it&apos;s even possible that &quot;nearest&quot; will select the server with the highest network latency.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#nearest&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;driver server selection spec&lt;/a&gt; explains this behavior and the unfortunate naming pretty clearly: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The term &apos;nearest&apos; is unfortunate, as it implies a choice based on geographic locality or absolute lowest latency, neither of which are true.&lt;/p&gt;

&lt;p&gt;Instead, and unlike the other read preference modes, &apos;nearest&apos; does not favor either primaries or secondaries; instead all servers are candidates and are filtered by tag_sets and maxStalenessSeconds.&lt;/p&gt;

&lt;p&gt;To always select the server with the lowest RTT, users should use mode &apos;nearest&apos; without tag_sets or maxStalenessSeconds and set localThresholdMS to zero.&lt;/p&gt;

&lt;p&gt;To distribute reads across all members evenly regardless of RTT, users should use mode &apos;nearest&apos; without tag_sets or maxStalenessSeconds and set localThresholdMS very high so that all servers fall within the latency window.&lt;/p&gt;

&lt;p&gt;In both cases, tag_sets and maxStalenessSeconds could be used to further restrict the set of eligible servers, if desired.&lt;/p&gt;&lt;/blockquote&gt;


&lt;h2&gt;&lt;a name=&quot;Scopeofchanges&quot;&gt;&lt;/a&gt;Scope of changes&lt;/h2&gt;

&lt;h2&gt;&lt;a name=&quot;ImpacttoOtherDocs&quot;&gt;&lt;/a&gt;Impact to Other Docs&lt;/h2&gt;

&lt;h2&gt;&lt;a name=&quot;MVP%28WorkandDate%29&quot;&gt;&lt;/a&gt;MVP (Work and Date)&lt;/h2&gt;

&lt;h2&gt;&lt;a name=&quot;Resources%28ScopeorDesignDocs%2CInvision%2Cetc.%29&quot;&gt;&lt;/a&gt;Resources (Scope or Design Docs, Invision, etc.)&lt;/h2&gt;
</description>
                <environment></environment>
        <key id="1539346">DOCS-13981</key>
            <summary>Documentation for &quot;nearest&quot; read preference is incorrect</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="andrew.feierabend@mongodb.com">Andrew Feierabend</assignee>
                                    <reporter username="shane.harvey@mongodb.com">Shane Harvey</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Nov 2020 18:26:43 +0000</created>
                <updated>Mon, 30 Oct 2023 20:17:02 +0000</updated>
                            <resolved>Wed, 13 Jan 2021 21:37:35 +0000</resolved>
                                                    <fixVersion>Server_Docs_20231030</fixVersion>
                                    <component>manual</component>
                    <component>Server</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3581377" author="xgen-internal-githook" created="Mon, 25 Jan 2021 20:30:28 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Feierabend&apos;, &apos;email&apos;: &apos;andrew.feierabend@mongodb.com&apos;, &apos;username&apos;: &apos;andf-mongodb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-13981&quot; title=&quot;Documentation for &amp;quot;nearest&amp;quot; read preference is incorrect&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-13981&quot;&gt;&lt;del&gt;DOCS-13981&lt;/del&gt;&lt;/a&gt; clarify read preference nearest&lt;br/&gt;
Branch: v4.2.12&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/1f9e5d6446d560bc4fee7def812f35e1284009ba&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/1f9e5d6446d560bc4fee7def812f35e1284009ba&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3563614" author="xgen-internal-githook" created="Wed, 13 Jan 2021 21:35:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Feierabend&apos;, &apos;email&apos;: &apos;andrew.feierabend@mongodb.com&apos;, &apos;username&apos;: &apos;andf-mongodb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-13981&quot; title=&quot;Documentation for &amp;quot;nearest&amp;quot; read preference is incorrect&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-13981&quot;&gt;&lt;del&gt;DOCS-13981&lt;/del&gt;&lt;/a&gt; clarify read preference nearest&lt;br/&gt;
Branch: v3.6&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/72116cd020c0f42b411e1bea1dc1ac9c891e3054&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/72116cd020c0f42b411e1bea1dc1ac9c891e3054&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3563610" author="xgen-internal-githook" created="Wed, 13 Jan 2021 21:34:05 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Feierabend&apos;, &apos;email&apos;: &apos;andrew.feierabend@mongodb.com&apos;, &apos;username&apos;: &apos;andf-mongodb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-13981&quot; title=&quot;Documentation for &amp;quot;nearest&amp;quot; read preference is incorrect&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-13981&quot;&gt;&lt;del&gt;DOCS-13981&lt;/del&gt;&lt;/a&gt; clarify read preference nearest&lt;br/&gt;
Branch: v4.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/52225f9db18b5c8f3642efea53ebaf230d6e0a11&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/52225f9db18b5c8f3642efea53ebaf230d6e0a11&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3563602" author="xgen-internal-githook" created="Wed, 13 Jan 2021 21:32:03 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Feierabend&apos;, &apos;email&apos;: &apos;andrew.feierabend@mongodb.com&apos;, &apos;username&apos;: &apos;andf-mongodb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-13981&quot; title=&quot;Documentation for &amp;quot;nearest&amp;quot; read preference is incorrect&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-13981&quot;&gt;&lt;del&gt;DOCS-13981&lt;/del&gt;&lt;/a&gt; clarify read preference nearest&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/1f9e5d6446d560bc4fee7def812f35e1284009ba&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/1f9e5d6446d560bc4fee7def812f35e1284009ba&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3563596" author="xgen-internal-githook" created="Wed, 13 Jan 2021 21:29:14 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Feierabend&apos;, &apos;email&apos;: &apos;andrew.feierabend@mongodb.com&apos;, &apos;username&apos;: &apos;andf-mongodb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-13981&quot; title=&quot;Documentation for &amp;quot;nearest&amp;quot; read preference is incorrect&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-13981&quot;&gt;&lt;del&gt;DOCS-13981&lt;/del&gt;&lt;/a&gt; clarify read preference nearest&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/75f8b5a8dd5a327e883cbd60dd28a34148b5bc70&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/75f8b5a8dd5a327e883cbd60dd28a34148b5bc70&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3563595" author="xgen-internal-githook" created="Wed, 13 Jan 2021 21:28:42 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Andrew Feierabend&apos;, &apos;email&apos;: &apos;andrew.feierabend@mongodb.com&apos;, &apos;username&apos;: &apos;andf-mongodb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-13981&quot; title=&quot;Documentation for &amp;quot;nearest&amp;quot; read preference is incorrect&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-13981&quot;&gt;&lt;del&gt;DOCS-13981&lt;/del&gt;&lt;/a&gt; clarify read preference nearest&lt;br/&gt;
Branch: v5.0&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/docs/commit/a172d094ea58760b66b916bced55b880bd9ae634&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/docs/commit/a172d094ea58760b66b916bced55b880bd9ae634&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>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 12 Jan 2021 20:34:38 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 2 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>DOCSP-11701</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>
                            3 years, 2 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andrew.feierabend@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>shane.harvey@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hygx8v:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hy2zgv:</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="4617">ServerDocs2020: Jan12 - Jan19</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.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|hygji7:</customfieldvalue>

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