<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:31 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-535] DB.getCollectionNames() fails when connected to a secondary server even if ReadPreference is SECONDARY</title>
                <link>https://jira.mongodb.org/browse/JAVA-535</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;I want to get the list of collections in my database as reported by a secondary member of my replica set.  If I have a Mongo connection to that member, and I set the ReadPreference to secondary, I&apos;m able to successfully make queries and perform other operations, but I cannot call DB.getCollectionNames().  I get the same &quot;not talking to master and retries used up&quot; error that happens when ReadPreference isn&apos;t set correctly.  The issue appears to be here, where the ReadPreference isn&apos;t being used when querying the system.namespaces collection:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/DB.java#L283&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/blob/master/src/main/com/mongodb/DB.java#L283&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When using slaveOk() instead, this works as expected.  My understanding is that setReadPreference(SECONDARY) is supposed to behave the same way.&lt;/p&gt;</description>
                <environment></environment>
        <key id="32479">JAVA-535</key>
            <summary>DB.getCollectionNames() fails when connected to a secondary server even if ReadPreference is SECONDARY</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="robjectlabs">Robert Miyashiro</reporter>
                        <labels>
                    </labels>
                <created>Thu, 8 Mar 2012 00:48:28 +0000</created>
                <updated>Tue, 14 Aug 2012 16:22:54 +0000</updated>
                            <resolved>Mon, 14 May 2012 22:03:18 +0000</resolved>
                                                    <fixVersion>2.8.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="134055" author="jeff.yemin" created="Mon, 18 Jun 2012 19:36:11 +0000"  >&lt;p&gt;Closing for 2.8.0 release.&lt;/p&gt;</comment>
                            <comment id="119370" author="auto" created="Mon, 14 May 2012 21:55:38 +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-535&quot; title=&quot;DB.getCollectionNames() fails when connected to a secondary server even if ReadPreference is SECONDARY&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-535&quot;&gt;&lt;del&gt;JAVA-535&lt;/del&gt;&lt;/a&gt;: Respecting read preference on DB for DB.getCollectionNames&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/1d906071f8b38063ed1d26c99891cc1212faf7da&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/1d906071f8b38063ed1d26c99891cc1212faf7da&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="119366" author="jeff.yemin" created="Mon, 14 May 2012 21:46:58 +0000"  >&lt;p&gt;This is actually a separate bug from the one it was resolved as a duplicate of, since getCollectionNames is not implemented as a command.&lt;/p&gt;</comment>
                            <comment id="97779" author="jeff.yemin" created="Mon, 12 Mar 2012 13:40:11 +0000"  >&lt;p&gt;This is the same issue as &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-497&quot; title=&quot;ReadPrefs ignored for commands&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-497&quot;&gt;&lt;del&gt;JAVA-497&lt;/del&gt;&lt;/a&gt;, so I&apos;m going to close as a duplicate.  Please track progress on the duplicated issue.&lt;/p&gt;</comment>
                            <comment id="96646" author="robjectlabs" created="Thu, 8 Mar 2012 01:20:45 +0000"  >&lt;p&gt;Yes, a URI that looks like this:  mongodb://secondary.foo.com:12345&lt;br/&gt;
We&apos;re also using the MongoHolder.connect() method if that&apos;s relevant.&lt;/p&gt;</comment>
                            <comment id="96644" author="scotthernandez" created="Thu, 8 Mar 2012 01:15:24 +0000"  >&lt;p&gt;How are you connecting? Just with the single address of a secondary?&lt;/p&gt;</comment>
                            <comment id="96642" author="robjectlabs" created="Thu, 8 Mar 2012 01:03:27 +0000"  >&lt;p&gt;We&apos;re using 2.7.3&lt;/p&gt;</comment>
                            <comment id="96640" author="scotthernandez" created="Thu, 8 Mar 2012 00:54:00 +0000"  >&lt;p&gt;What version are you using? If you aren&apos;t using the latest versoin please do, there was a bug in 2.7.0/1 I believe.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="27136">JAVA-497</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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|hrhb9r:</customfieldvalue>

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