<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:13:39 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-1931] operation_id bugs in command monitoring callbacks</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-1931</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;In our current Application Performance Monitoring (APM) implementation, a series of commands could be monitored with the same operation_id. We must generate unique ids.&lt;/p&gt;

&lt;p&gt;Also, a series of commands related to the same mongoc_bulk_operation_t could have different ids, since we use the mongoc_cluster_t&apos;s operation_id instead of the mongoc_bulk_operation_t&apos;s. We should monitor all commands for one bulk operation with the same id, from the mongoc_bulk_operation_t.&lt;/p&gt;

&lt;p&gt;And finally, mongoc_bulk_operation_new creates a bulk op with operation_id of zero. The bug described above means we aren&apos;t using the mongoc_bulk_operation_t&apos;s operation_id, anyway, but we should fix that and also initialize the operation_id.&lt;/p&gt;

&lt;p&gt;Original report from David Golden:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&quot;mongoc_bulk_operation_new does not fully initialize the structure&quot;&lt;/p&gt;

&lt;p&gt;mongoc_bulk_operation_new and _mongoc_bulk_operation_new initialize the data structure in subtly different ways.  It&apos;s not clear why these are different and I&apos;m concerned that HLL wrappers are missing something by using mongoc_bulk_operation_new instead of _mongoc_bulk_operation_new.&lt;/p&gt;&lt;/blockquote&gt;</description>
                <environment></environment>
        <key id="333047">CDRIVER-1931</key>
            <summary>operation_id bugs in command monitoring callbacks</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="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="david.golden@mongodb.com">David Golden</reporter>
                        <labels>
                    </labels>
                <created>Sat, 19 Nov 2016 02:09:20 +0000</created>
                <updated>Thu, 19 Jan 2017 13:48:54 +0000</updated>
                            <resolved>Thu, 19 Jan 2017 13:14:25 +0000</resolved>
                                                    <fixVersion>1.6.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1480185" author="xgen-internal-githook" created="Thu, 19 Jan 2017 13:48:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;ajdavis&apos;, u&apos;name&apos;: u&apos;A. Jesse Jiryu Davis&apos;, u&apos;email&apos;: u&apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-1931&quot; title=&quot;operation_id bugs in command monitoring callbacks&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-1931&quot;&gt;&lt;del&gt;CDRIVER-1931&lt;/del&gt;&lt;/a&gt; fix operation ids for APM&lt;/p&gt;

&lt;p&gt;Fix the Application Performance Monitoring implementation. A series of commands&lt;br/&gt;
could be monitored with the same operation_id. Now we generate unique ids.&lt;/p&gt;

&lt;p&gt;Also, a series of commands related to the same mongoc_bulk_operation_t could&lt;br/&gt;
have different ids. Now, we monitor all commands for one bulk operation with&lt;br/&gt;
the same id.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/ff8ec7b1c6384527402cb893971bfa4cc58dd6d7&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/ff8ec7b1c6384527402cb893971bfa4cc58dd6d7&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1471878" author="jesse" created="Sat, 7 Jan 2017 14:30:06 +0000"  >&lt;p&gt;Good idea David, I&apos;ll do that.&lt;/p&gt;</comment>
                            <comment id="1471799" author="david.golden" created="Sat, 7 Jan 2017 04:26:05 +0000"  >&lt;p&gt;The C++ driver API allows users to construct bulk operations independent of any particular client/db/collection.  The bulk operation is provided to the &lt;tt&gt;bulk_write&lt;/tt&gt; collection method, which sets client/db/collection at that time and then executes the bulk.  Therefore, it uses &lt;tt&gt;mongoc_bulk_operation_new&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;I wonder if &lt;tt&gt;mongoc_bulk_operation_set_client&lt;/tt&gt; should also update the &lt;tt&gt;operation_id&lt;/tt&gt;.&lt;/p&gt;</comment>
                            <comment id="1471789" author="jesse" created="Sat, 7 Jan 2017 03:23:30 +0000"  >&lt;p&gt;mongoc_bulk_operation_new sets bypass_document_validation, ordered. server_id is set to 0. The other fields are set to reasonable defaults implicitly, since the whole struct is allocated and cleared by bson_malloc0.&lt;/p&gt;

&lt;p&gt;The other fields that &lt;b&gt;must&lt;/b&gt; be set before executing the operation are database, collection, client, and commands. Those fields can be set by public functions like mongoc_bulk_operation_set_database and so on. test_bulk_new() checks that mongoc_bulk_operation_execute() fails with an error code if these fields aren&apos;t all set before you call it.&lt;/p&gt;

&lt;p&gt;The one field that seems buggy is operation_id. I suspect that if you monitor a bulk insert after calling mongoc_bulk_operation_new, all the operation id&apos;s will be zero.&lt;/p&gt;

&lt;p&gt;Out of curiosity: why use mongoc_bulk_operation_new instead of mongoc_collection_create_bulk_operation?&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|hssupr:</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>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="1481">C Driver 2017 1 - Jan 20, 2017</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>