<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:20:09 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-4171] Single-threaded server selection should eagerly validate service ID </title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4171</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/load-balancers/load-balancers.rst#connection-establishment&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Load Balancer: Connection Establishment&lt;/a&gt; states:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;When the server&apos;s hello response does not contain a serviceId field, the driver MUST throw an exception&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This does not appear to happen when I&apos;d expect for single-threaded clients in libmongoc.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;mongoc_client_select_server&lt;/tt&gt; calls &lt;tt&gt;mongoc_topology_select&lt;/tt&gt;, which immediately uses &lt;tt&gt;mongoc_topology_select_server_id&lt;/tt&gt; to obtain a server ID. For a LB topology, that function will only call &lt;tt&gt;mongoc_topology_select_server_id_loadbalanced&lt;/tt&gt;, which &lt;em&gt;does&lt;/em&gt; select a node and verify that node-&amp;gt;stream is non-null (else we get a &quot;Could not establish stream for node&quot; error). However, that doesn&apos;t result in &lt;tt&gt;_mongoc_cluster_stream_for_server&lt;/tt&gt; getting called at all, which is where the validation of service ID takes place.&lt;/p&gt;

&lt;p&gt;In practice, this means there is essentially a second state between server selection and executing an operation where we might have selected a LB but won&apos;t realize the service ID is missing until the user executes an operation. Historically, PHP has relied on libmongoc&apos;s single-threaded server selection to always initialize the connection(s) (and SDAM, although that doesn&apos;t apply for LB topologies). Since executing &lt;tt&gt;hello&lt;/tt&gt; is part of connection establishment, it seems reasonable that we&apos;d also validate the service ID at that point.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1888064">CDRIVER-4171</key>
            <summary>Single-threaded server selection should eagerly validate service ID </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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Fri, 1 Oct 2021 17:30:39 +0000</created>
                <updated>Thu, 31 Mar 2022 13:25:16 +0000</updated>
                                            <version>1.19.0</version>
                                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1889011">CDRIVER-4174</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|hznq4n:</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>