<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:20 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>[JAVA-458] with slaveOk, query distribution to slave is not even</title>
                <link>https://jira.mongodb.org/browse/JAVA-458</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;For a 3 node replset, looks like 1 slave is hit 80% and the other one 20%.&lt;br/&gt;
Saw similar finding from a user doing load testing.&lt;/p&gt;</description>
                <environment></environment>
        <key id="24075">JAVA-458</key>
            <summary>with slaveOk, query distribution to slave is not even</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="9">Done</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="antoine">Antoine Girbal</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Oct 2011 05:02:28 +0000</created>
                <updated>Mon, 18 Jun 2012 19:36:10 +0000</updated>
                            <resolved>Thu, 5 Apr 2012 18:22:09 +0000</resolved>
                                                    <fixVersion>2.8.0</fixVersion>
                                                        <votes>2</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="134052" author="jeff.yemin" created="Mon, 18 Jun 2012 19:36:10 +0000"  >&lt;p&gt;Closing for 2.8.0 release.&lt;/p&gt;</comment>
                            <comment id="120545" author="auto" created="Thu, 17 May 2012 15:23:23 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-458&quot; title=&quot;with slaveOk, query distribution to slave is not even&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-458&quot;&gt;&lt;del&gt;JAVA-458&lt;/del&gt;&lt;/a&gt;: Fixed regression which caused nodes not in the seed list to be ignored until the second round of calls to isMaster.  This could result in not finding the primary for &amp;gt; 5s if the primary didn&apos;t happen to be in the seed list&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/917d760b3bbcc073dadd14e565c521feeee19fe3&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/917d760b3bbcc073dadd14e565c521feeee19fe3&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="107564" author="hodgesz" created="Sat, 7 Apr 2012 14:21:54 +0000"  >&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;We are using version 2.7.3 of the Java driver with version 2.7.3 of a 5 node replica set.  We have noticed this issue where under load only the master and one of the slave nodes receive the bulk of the traffic.  It seemed to be higher than the 80% mentioned above, but we didn&apos;t drill down to determine the actual distribution percentage.&lt;/p&gt;

&lt;p&gt;We will definitely grab 2.8.0 when it is released, but until then we were curious if you might be able to suggest a suitable workaround.  Is it possible to create two instances of the Java driver, one configured for the writes and map/reduce and the other for the reads?  For the read instance would it be possible to only use a subset of the 5 node replica set to connect to that doesn&apos;t include the master, maybe just 3 of the nodes that weren&apos;t getting leveraged?&lt;/p&gt;

&lt;p&gt;Thanks in advance,&lt;/p&gt;

&lt;p&gt;Jonathan Hodges&lt;/p&gt;</comment>
                            <comment id="107074" author="jeff.yemin" created="Thu, 5 Apr 2012 18:22:09 +0000"  >&lt;p&gt;The expected behavior was that all slave-ok queries would be evenly load-balance across all secondaries within 15 ms (overridable using com.mongodb.slaveAcceptableLatencyMS system property) of the fastest secondary.  This is now what actually happens.&lt;/p&gt;

&lt;p&gt;As before, the ping times for each member of the replica are still measureed in a background thread (named &quot;ReplicaSetStatus:Updater&quot;).  This thread (one for each instance on Mongo created) loops through each member of the replica set, calling the &quot;isMaster&quot; command on each, and measures the latency of the call for each member.  It then sleeps for 5000 ms before doing it again (configurable with the &quot;com.mongodb.updaterIntervalMS&quot; system property.  &lt;/p&gt;

&lt;p&gt;In addition, if no primary was found, instead of sleeping for 5000 ms, it only sleeps for 10 ms before trying again, so that the client finds the new primary fairly fast but without spamming it too hard.  This interval is configurable with the &quot;com.mongodb.updaterIntervalNoMasterMS&quot; system property.&lt;/p&gt;

&lt;p&gt;One other behavioral change: All readers and writers block until at least one pass through the replica set in the updater thread has completed.  &lt;/p&gt;</comment>
                            <comment id="107018" author="auto" created="Thu, 5 Apr 2012 16:34:37 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;jyemin&apos;, u&apos;name&apos;: u&apos;Jeff Yemin&apos;, u&apos;email&apos;: u&apos;jeff.yemin@10gen.com&apos;}
&lt;p&gt;Message: Merge branch &apos;master&apos; into &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-458&quot; title=&quot;with slaveOk, query distribution to slave is not even&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-458&quot;&gt;&lt;del&gt;JAVA-458&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/d4226865fdd0ea2923e48d789547ff5604a4ff71&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/d4226865fdd0ea2923e48d789547ff5604a4ff71&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="20086">JAVA-400</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrhblj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14679</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>