<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:24:44 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>[DRIVERS-2102] Do not prohibit retryability for all commands issued from bulkWrite() due to requests</title>
                <link>https://jira.mongodb.org/browse/DRIVERS-2102</link>
                <project id="10980" key="DRIVERS">Drivers</project>
                    <description>&lt;p&gt;While testing CDRIVER and PHPC with APM to inspect command documents, I noticed something surprising. If a bulk operation contains a series of single-document operations (e.g. deleteOne, updateOne) followed by a final multi-document operation (e.g. updateMany), only the final command containing the unsupported operation excludes a transaction ID. Based on the language in &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.rst#unsupported-write-operations&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Unsupported Write Operations&lt;/a&gt;, I might expect that one unsupported operation to cause all commands to exclude a transaction ID:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the context of the CRUD specification, this includes the updateMany() and deleteMany() methods as well as &lt;b&gt;bulkWrite() where the requests parameter includes an UpdateMany or DeleteMany operation&lt;/b&gt;. Drivers MUST NOT add a transaction ID to any single- or multi-statement write commands that include one or more multi-document write operations. Drivers MUST NOT retry these commands if they fail to return a response.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This reason for this behavior is that libmongoc checks for a &quot;multi&quot; operation while building individual write command documents (similar to its checks for &quot;collation&quot; option usage), rather than in its bulk write API where delete, insert, and update operations are added.&lt;/p&gt;

&lt;p&gt;I&apos;ve forgotten the thought process that went into the above citation from the retryable writes spec, but I don&apos;t see anything technically wrong with what libmongoc is doing. Therefore, I propose rewording the spec to relax the tainting of an entire &lt;tt&gt;bulkWrite()&lt;/tt&gt; based on its requests parameter and instead allow drivers the flexibility to taint individual write commands within a &lt;tt&gt;bulkWrite()&lt;/tt&gt;. This would result in emphasizing the sentence that followed the bolded segment above:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Drivers MUST NOT add a transaction ID to any single- or multi-statement write commands that include one or more multi-document write operations.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I should note that the spec&apos;s JSON tests didn&apos;t catch this, as they are focused on testing retryable behavior in the face of network errors (i.e. fail point triggers). I ultimately caught this while implementing the &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.rst#test-plan&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Test Plan&lt;/a&gt; discussed in the spec document, which says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If possible, drivers should test that transaction IDs are never included in commands for unsupported write operations:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Unsupported multi-statement write operations
	&lt;ul&gt;
		&lt;li&gt;bulkWrite() that includes UpdateMany or DeleteMany&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;</description>
                <environment></environment>
        <key id="473894">DRIVERS-2102</key>
            <summary>Do not prohibit retryability for all commands issued from bulkWrite() due to requests</summary>
                <type id="14901" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14700&amp;avatarType=issuetype">Spec Change</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="-1">Unassigned</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Mon, 18 Dec 2017 19:22:56 +0000</created>
                <updated>Wed, 29 Jun 2022 20:38:15 +0000</updated>
                            <resolved>Wed, 29 Jun 2022 20:38:15 +0000</resolved>
                                                        <component>Retryability</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="4649037" author="jmikola@gmail.com" created="Wed, 29 Jun 2022 20:38:01 +0000"  >&lt;p&gt;I concur. SPEC-1065 addresses the ask in this issue.&lt;/p&gt;</comment>
                            <comment id="4648964" author="kaitlin.mahar" created="Wed, 29 Jun 2022 20:08:33 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jmikola%40mongodb.com&quot; class=&quot;user-hover&quot; rel=&quot;jmikola@mongodb.com&quot;&gt;jmikola@mongodb.com&lt;/a&gt; I&apos;ve just been going through the backlog looking at bulk related tickets and found this one. The proposed change here seems like it was made a long time ago via SPEC-1065. Can we close this?&lt;/p&gt;</comment>
                            <comment id="1767912" author="behackett" created="Mon, 8 Jan 2018 18:26:28 +0000"  >&lt;blockquote&gt;&lt;p&gt;Therefore, I propose rewording the spec to relax the tainting of an entire bulkWrite() based on its requests parameter and instead allow drivers the flexibility to taint individual write commands within a bulkWrite().&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I agree. Make it so.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                                        </outwardlinks>
                                                                <inwardlinks description="is duplicated by">
                                                        </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_10257" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Documentation Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="11861"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10951" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Driver Changes</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10940"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hte31j:</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>