<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:10:45 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>[CDRIVER-829] Queries with non-primary read preference on secondaries should set slaveOk flag</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-829</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;From &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#read-operations:&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#read-operations:&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;For all read preferences modes except &apos;primary&apos;, clients MUST set the slaveOK wire protocol flag to ensure that any suitable server can handle the request. Clients MUST NOT set the slaveOK wire protocol flag if the read preference mode is &apos;primary&apos;.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;In &lt;a href=&quot;https://github.com/mongodb-labs/mongo-php-driver-prototype/pull/98#discussion_r38763073&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this PR on the PHP driver&lt;/a&gt;, I have a test that sends a query to a secondary via &lt;tt&gt;mongoc_collection_find()&lt;/tt&gt; where:&lt;/p&gt;

&lt;p&gt;1. we forcefully set the cursor&apos;s hint to that secondary&apos;s server ID&lt;br/&gt;
2. we do not pass a read preference to &lt;tt&gt;mongoc_collection_find()&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;This triggers a &quot;not master and slaveOk=false&quot; error, which seems contrary to the SS spec.&lt;/p&gt;

&lt;p&gt;As an aside: I think we could still trigger a &quot;not master and slaveOk=false&quot; error from the secondary if we passed a primary-only read preference to &lt;tt&gt;mongoc_collection_find()&lt;/tt&gt; and still force the cursor hint.&lt;/p&gt;</description>
                <environment></environment>
        <key id="228512">CDRIVER-829</key>
            <summary>Queries with non-primary read preference on secondaries should set slaveOk flag</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="3">Duplicate</resolution>
                                        <assignee username="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Fri, 4 Sep 2015 18:56:11 +0000</created>
                <updated>Wed, 3 May 2017 22:14:59 +0000</updated>
                            <resolved>Fri, 4 Sep 2015 22:29:40 +0000</resolved>
                                    <version>1.2-beta1</version>
                                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1023001" author="jesse" created="Fri, 4 Sep 2015 22:29:35 +0000"  >&lt;p&gt;Already working on it as we speak.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="210508">CDRIVER-704</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|hscxfr:</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>