<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:21 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-467] Calling setReadPreference(ReadPreference.SECONDARY) is not reading from secondary servers</title>
                <link>https://jira.mongodb.org/browse/JAVA-467</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;In a test environment with 4 MongoDB instances, all the reads in the attached test code are executed against only the master server.  This is identified by the watching the console of each of the instances, and the CPU of the machines on which the instances are running.&lt;/p&gt;

&lt;p&gt;The call the DBCursor.getServerAddress() is not working either, it only returns a null, so that we cannot verify where the reads are being executed.  (Not sure if this is related.)&lt;/p&gt;
</description>
                <environment></environment>
        <key id="24587">JAVA-467</key>
            <summary>Calling setReadPreference(ReadPreference.SECONDARY) is not reading from secondary servers</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="antoine">Antoine Girbal</assignee>
                                    <reporter username="jason nethercott">Jason Nethercott</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Nov 2011 15:08:52 +0000</created>
                <updated>Thu, 1 May 2014 16:00:14 +0000</updated>
                            <resolved>Sat, 19 Nov 2011 14:49:41 +0000</resolved>
                                                    <fixVersion>2.7.2</fixVersion>
                                    <component>Cluster Management</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="72597" author="auto" created="Mon, 12 Dec 2011 21:55:40 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-467&quot; title=&quot;Calling setReadPreference(ReadPreference.SECONDARY) is not reading from secondary servers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-467&quot;&gt;&lt;del&gt;JAVA-467&lt;/del&gt;&lt;/a&gt;: cur.toString() should not block&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/45b2dd89505fb155af34d194205ebc8461e04e0f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/45b2dd89505fb155af34d194205ebc8461e04e0f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="72578" author="auto" created="Mon, 12 Dec 2011 21:26:24 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;bwmcadams&apos;, u&apos;name&apos;: u&apos;Brendan W. McAdams&apos;, u&apos;email&apos;: u&apos;brendan@10gen.com&apos;}
&lt;p&gt;Message: Tests utterly fail with this commit; as a result, rolling back.&lt;/p&gt;

&lt;p&gt;Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-467&quot; title=&quot;Calling setReadPreference(ReadPreference.SECONDARY) is not reading from secondary servers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-467&quot;&gt;&lt;del&gt;JAVA-467&lt;/del&gt;&lt;/a&gt;: removed call to _check() from within getServerAddress because this method should not block.&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 9ae9483639d064a41f873b4063582c7b782000b8.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/85f0f750bb10ecb44c42204b096c039c2dd7c222&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/85f0f750bb10ecb44c42204b096c039c2dd7c222&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="68374" author="auto" created="Tue, 22 Nov 2011 21:35:23 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-467&quot; title=&quot;Calling setReadPreference(ReadPreference.SECONDARY) is not reading from secondary servers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-467&quot;&gt;&lt;del&gt;JAVA-467&lt;/del&gt;&lt;/a&gt;: removed call to _check() from within getServerAddress because this method should not block.&lt;br/&gt;
It is used for information purpose and docs states it is null until data has been returned.&lt;br/&gt;
One example is that it made cursor.toString() block on long queries.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/9ae9483639d064a41f873b4063582c7b782000b8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/9ae9483639d064a41f873b4063582c7b782000b8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="65326" author="rgnitz" created="Tue, 8 Nov 2011 02:42:55 +0000"  >&lt;p&gt;Hi Jason,&lt;/p&gt;

&lt;p&gt;Thanks for bringing this to our attention (and sorry about the headaches).&lt;/p&gt;

&lt;p&gt;I attached a patched library. Can you run in your environment and confirm everything is working properly?&lt;/p&gt;

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

&lt;p&gt;-Ryan&lt;/p&gt;</comment>
                            <comment id="65325" author="auto" created="Tue, 8 Nov 2011 02:36:27 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;rgnitz&apos;, u&apos;name&apos;: u&apos;Ryan&apos;, u&apos;email&apos;: u&apos;rgnitz@gmail.com&apos;}
&lt;p&gt;Message: added _check call to getServerAddress if _it is null - &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-467&quot; title=&quot;Calling setReadPreference(ReadPreference.SECONDARY) is not reading from secondary servers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-467&quot;&gt;&lt;del&gt;JAVA-467&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/daa7f7416a4facb295e6b596558a6dc57bac88b0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/daa7f7416a4facb295e6b596558a6dc57bac88b0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="65313" author="auto" created="Tue, 8 Nov 2011 01:42:10 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;rgnitz&apos;, u&apos;name&apos;: u&apos;Ryan&apos;, u&apos;email&apos;: u&apos;rgnitz@gmail.com&apos;}
&lt;p&gt;Message: Moved variable calls to method to fix read preference hierarchy - &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-467&quot; title=&quot;Calling setReadPreference(ReadPreference.SECONDARY) is not reading from secondary servers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-467&quot;&gt;&lt;del&gt;JAVA-467&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/253ca0772dc5cdca8c3092d62dfd434690fcf337&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/253ca0772dc5cdca8c3092d62dfd434690fcf337&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="65137" author="jason nethercott" created="Mon, 7 Nov 2011 15:09:23 +0000"  >&lt;p&gt;Affected version is 2.7.0, however, it&apos;s not listed in JIRA.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="131112">JAVA-1167</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="13770" name="mongo.jar" size="291442" author="rn@deftlabs.com" created="Tue, 8 Nov 2011 02:41:37 +0000"/>
                            <attachment id="13762" name="testMongoSecondayReads.java" size="1884" author="jason nethercott" created="Mon, 7 Nov 2011 15:08:52 +0000"/>
                    </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|hrhbjz:</customfieldvalue>

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