<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:35:59 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>[GODRIVER-1239] mongo.Client&apos;s Ping method ignores read preference</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-1239</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;In the &lt;tt&gt;(mongo.Client).Ping(context.Context, *readpref.ReadPref)&lt;/tt&gt; &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/b10ab43bc55226d7d7f7314f4525fcfe6547af7e/mongo/client.go#L135&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;method&lt;/a&gt;, it looks like the &lt;tt&gt;ReadPref&lt;/tt&gt; argument isn&apos;t actually used. The &lt;tt&gt;Client&lt;/tt&gt;  &apos;s readpref is also not used as the default when running the command. Instead, it seems that on &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/b10ab43bc55226d7d7f7314f4525fcfe6547af7e/mongo/database.go#L136&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this line&lt;/a&gt;, the read preference defaults to primary.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;Ping&lt;/tt&gt; should use the argued read preference if it is non-nil, and should use &lt;tt&gt;c.readPreference&lt;/tt&gt; if the argument is nil. This should be easily fixed by adding &lt;tt&gt;options.RunCmd().SetReadPreference(rp)&lt;/tt&gt; to &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/blob/b10ab43bc55226d7d7f7314f4525fcfe6547af7e/mongo/client.go#L145&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this method call&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="900442">GODRIVER-1239</key>
            <summary>mongo.Client&apos;s Ping method ignores read preference</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="alice.thum@mongodb.com">Alice Thum</assignee>
                                    <reporter username="matthew.chiaravalloti@mongodb.com">Matthew Chiaravalloti</reporter>
                        <labels>
                    </labels>
                <created>Mon, 19 Aug 2019 20:21:57 +0000</created>
                <updated>Sat, 28 Oct 2023 11:38:40 +0000</updated>
                            <resolved>Wed, 28 Aug 2019 13:51:34 +0000</resolved>
                                                    <fixVersion>1.1.1</fixVersion>
                                    <component>CRUD</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="2391525" author="divjot.arora" created="Tue, 27 Aug 2019 21:53:29 +0000"  >&lt;p&gt;commit link:&#160;&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/1200072987b5e44a7417684e573acbdb7bc94538&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/1200072987b5e44a7417684e573acbdb7bc94538&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2391393" author="alice.thum" created="Tue, 27 Aug 2019 21:03:57 +0000"  >&lt;p&gt;&lt;a href=&quot;https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/466470&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/466470&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <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|hr76sf:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>