<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:20:03 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-4142] Use separate handshake metadata for clients</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-4142</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;div class=&quot;panel&quot; style=&quot;background-color: #fafbfc;border-color: #21313c;border-style: solid;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot; style=&quot;background-color: #fafbfc;&quot;&gt;
&lt;h3&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/h3&gt;
&lt;p&gt;The &lt;tt&gt;mongoc_handshake_data_append&lt;/tt&gt; logic has some limitations as to how much data we can collect about our clients. Since the first call to `mongoc_handshake_data_append` locks in metadata, which is then used for all clients created afterwards, this can cause wrong data to be collected, even when &lt;tt&gt;mongoc_cleanup&lt;/tt&gt; is called correctly.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Motivation&quot;&gt;&lt;/a&gt;&lt;b&gt;Motivation&lt;/b&gt;&lt;/h3&gt;
&lt;p&gt;While evaluating the PHP driver usage on Atlas, I noticed that apparently 60% of our users only use the MongoDB extension, but not the high-level API. Based on personal observations, I consider this number to be way too low, which led me to suspecting that we are getting incorrect data.&lt;/p&gt;

&lt;p&gt;For one, the amount of data we can send is limited, and I&apos;m not sure we&apos;re sending the right data in the right format. However, this is not something that we can fix here, as the handshake spec defines what to do here. I&apos;ll file a separate DRIVERS ticket for that effort.&lt;/p&gt;

&lt;p&gt;Particularly for PHP, there are multiple places where we need to add info to the metadata. The PHP extension adds its own name and version, as does the PHP library. The Doctrine ODM does this as well, but this doesn&apos;t show up at all. There is a separate problem in ODM about this, but we&apos;d expect the PHP library information to show up correctly. However, the following code would report only usage for &lt;tt&gt;ext-mongodb&lt;/tt&gt;, but not for the library when both manager and client connect to the server:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;$manager = new MongoDB\Driver\Manager(null, [], [&apos;disableClientPersistence&apos; =&amp;gt; true]);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;$client = new MongoDB\Client(null, [], [&apos;disableClientPersistence&apos; =&amp;gt; true]);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;The first instantiation of a Manager object calls `mongoc_handshake_data_append`, which freezes the handshake struct, rendering the second call (when creating a new manager with different app metadata) useless and always reporting `ext-mongodb` usage.&lt;/p&gt;

&lt;p&gt;Changing this behaviour would not only help report correct data, but it also solves the issue if we look at the higher-level applications as well: if a customer used Symfony and Laravel and uses the same application server to run both applications, we&apos;d only ever get one usage reported, as PHP processes usually do not terminate (CLI being a notable exception) after serving a request. A PHP process that first handles a script that connects to MongoDB using Laravel, then later handles a script that connects to MongoDB using Symfony, we&apos;d never know the customer was using Symfony at all.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="1864027">CDRIVER-4142</key>
            <summary>Use separate handshake metadata for clients</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="andreas.braun@mongodb.com">Andreas Braun</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Aug 2021 11:59:16 +0000</created>
                <updated>Mon, 27 Feb 2023 20:23:59 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="316827">CDRIVER-1547</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1030546">CDRIVER-3441</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </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|hzjvrb:</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>