<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:15:12 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-2432] Unacknowledged writes should not include transaction ID or lsid for retryable writes</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2432</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;Per the &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.rst&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Retryable Writes spec&lt;/a&gt;, unacknowledged writes should never be retried. &lt;/p&gt;

&lt;p&gt;Also, the &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/sessions/driver-sessions.rst&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Sessions Spec says&lt;/a&gt; &quot;a driver MUST NOT send a session ID with unacknowledged writes. This is true for both implicit and explicit sessions.&quot;&lt;/p&gt;

&lt;p&gt;While testing PHPC with libmongoc 1.9.0-rc1, I discovered that libmongoc is still including transaction IDs in unacknowledged write commands. This is likely the result of &lt;tt&gt;_allow_txn_number()&lt;/tt&gt; in mongoc-cmd.c failing to return to return false. We should be able to trust that the &quot;writeConcern&quot; field, if any, is already merged into the write command before &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/1.9.0-rc1/src/mongoc/mongoc-cmd.c#L633&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;_allow_txn_number()&lt;/tt&gt; is called&lt;/a&gt;, so fixing this should only require &lt;tt&gt;_allow_txn_number()&lt;/tt&gt; checking for w:0.&lt;/p&gt;

&lt;p&gt;Additionally, this fix should catch the case where &lt;tt&gt;mongoc_cmd_parts_append_opts()&lt;/tt&gt; merged in a &quot;writeConcern&quot; option (from a &lt;tt&gt;with_opts()&lt;/tt&gt; function, or the user explicitly provided &quot;writeConcern&quot; in the original command document (as PHPLIB does through PHPC).&lt;/p&gt;

&lt;p&gt;Finally, the driver MUST NOT include &quot;lsid&quot; (the logical session ID) in unacknowledged writes.&lt;/p&gt;</description>
                <environment></environment>
        <key id="473898">CDRIVER-2432</key>
            <summary>Unacknowledged writes should not include transaction ID or lsid for retryable writes</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="13201">Fixed</resolution>
                                        <assignee username="xiangyu.yao@mongodb.com">Xiangyu Yao</assignee>
                                    <reporter username="jmikola@mongodb.com">Jeremy Mikola</reporter>
                        <labels>
                    </labels>
                <created>Mon, 18 Dec 2017 19:29:19 +0000</created>
                <updated>Sat, 28 Oct 2023 11:30:14 +0000</updated>
                            <resolved>Fri, 12 Jan 2018 20:19:04 +0000</resolved>
                                    <version>1.9.0</version>
                                    <fixVersion>1.10.0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="1773253" author="xgen-internal-githook" created="Fri, 12 Jan 2018 20:16:30 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;xiangyu.yao24@gmail.com&apos;, &apos;name&apos;: &apos;Xiangyu Yao&apos;, &apos;username&apos;: &apos;xy24&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2432&quot; title=&quot;Unacknowledged writes should not include transaction ID or lsid for retryable writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2432&quot;&gt;&lt;del&gt;CDRIVER-2432&lt;/del&gt;&lt;/a&gt; unacknowledged writes should not include transaction ID for retryable writes&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/2592972fe33b694837653822cc7c95cc82ad3be2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/2592972fe33b694837653822cc7c95cc82ad3be2&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1768442" author="jesse" created="Tue, 9 Jan 2018 00:03:56 +0000"  >&lt;p&gt;Thanks Jeremy. findAndModify doesn&apos;t allow unacknowledged writes (the driver and server ignore you if you include writeConcern: {w: 0}). But this is certainly an issue for generic command runners and basic write operations.&lt;/p&gt;</comment>
                            <comment id="1768325" author="jmikola@gmail.com" created="Mon, 8 Jan 2018 22:25:06 +0000"  >&lt;p&gt;&lt;tt&gt;mongoc_cmd_parts_assemble()&lt;/tt&gt; is called from several contexts, so &lt;tt&gt;_allow_txn_number()&lt;/tt&gt; would still be called from other command execution paths (e.g. generic command runners, findAndModify).&lt;/p&gt;

&lt;p&gt;That said, it&apos;s possible that &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/aa0f6974d72e3981cb5df0881ff71991e9e5c3b5/src/mongoc/mongoc-write-command.c#L442&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the line you referenced&lt;/a&gt; in &lt;tt&gt;mongoc-write-command.c&lt;/tt&gt; prematurely assigns &lt;tt&gt;MONGOC_CMD_PARTS_ALLOW_TXN_NUMBER_YES&lt;/tt&gt;. An unacknowledged write concern should prohibit a transaction number just as multi writes do.&lt;/p&gt;

&lt;p&gt;Side note: I believe I reported this ticket with basic write operations (i.e. insert, update, delete) in mind, but I think we should also consider unacknowledged write concerns on other commands (e.g. findAndModify) and ensure those are not retried.&lt;/p&gt;</comment>
                            <comment id="1768251" author="xiangyu.yao" created="Mon, 8 Jan 2018 21:45:28 +0000"  >&lt;p&gt;It seems &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/aa0f6974d72e3981cb5df0881ff71991e9e5c3b5/src/mongoc/mongoc-write-command.c#L442&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this line&lt;/a&gt; already determines whether the transaction ID should be included or not before &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/aa0f6974d72e3981cb5df0881ff71991e9e5c3b5/src/mongoc/mongoc-write-command.c#L454&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongoc_cmd_parts_assemble&lt;/a&gt; which eventually uses &lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/blob/aa0f6974d72e3981cb5df0881ff71991e9e5c3b5/src/mongoc/mongoc-cmd.c#L644&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_allow_txn_number()&lt;/a&gt;. So I guessed _allow_txn_number() was actually never used probably? &lt;/p&gt;</comment>
                            <comment id="1764170" author="jesse" created="Wed, 3 Jan 2018 18:38:38 +0000"  >&lt;p&gt;Xiangyu, you should test this with a mock_server_t.&lt;/p&gt;</comment>
                            <comment id="1754858" author="jmikola@gmail.com" created="Mon, 18 Dec 2017 19:33:18 +0000"  >&lt;p&gt;Until &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2366&quot; title=&quot;Use OP_MSG for unacknowledged writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2366&quot;&gt;&lt;del&gt;CDRIVER-2366&lt;/del&gt;&lt;/a&gt; is implemented in 1.10, unacknowledged writes issued to a 3.6 server are executing with OP_MSG and await a server response.&lt;/p&gt;

&lt;p&gt;I&apos;ll defer to &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jesse&quot; class=&quot;user-hover&quot; rel=&quot;jesse&quot;&gt;jesse&lt;/a&gt; is this issue should be addressed in 1.9.x or wait until 1.10.&lt;/p&gt;

&lt;p&gt;Note that the server doesn&apos;t care if we retry unacknowledged writes. This requirement is just something we decided to enforce on the client side for consistency across all drivers (see: &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.rst#why-are-unacknowledged-write-concerns-unsupported&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Why are unacknowledged write concerns unsupported?&lt;/a&gt;).&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="500054">DRIVERS-456</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="500701">PHPC-1126</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="529736">CDRIVER-2615</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="704592">PHPC-1341</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="457696">CDRIVER-2366</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <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|hte32f:</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>