<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 22:05: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>[CXX-2347] Allow hint for unacknowledged writes using OP_MSG when supported by the server</title>
                <link>https://jira.mongodb.org/browse/CXX-2347</link>
                <project id="11980" key="CXX">C++ Driver</project>
                    <description>&lt;p&gt;&lt;b&gt;Downstream changes&lt;/b&gt;: Drivers should no longer prohibit using &lt;tt&gt;hint&lt;/tt&gt; with an unacknowledged write concern for update, delete, and findAndModify commands (issued via OP_MSG) and related helpers (e.g. UpdateOne, bulkWrite, findOneAndDelete) if &lt;tt&gt;hint&lt;/tt&gt; is known to be supported by the server executing the operation (i.e. 4.2+ for update commands, 4.4+ for delete and findAndModify). Drivers should sync unified CRUD tests with &lt;a href=&quot;https://github.com/mongodb/specifications/commit/59a5dadb2eeab8bba5a7d9a9acd47aa8c1d594cf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb/specifications@59a5dad&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;This reverts DRIVERS-991, which instructed drivers to raise a client-side error when the &lt;tt&gt;hint&lt;/tt&gt; option is provided with an unacknowledged write issued against any server version.&lt;/p&gt;

&lt;p&gt;When the the server is known to support &lt;tt&gt;hint&lt;/tt&gt; (i.e. 4.2+ for update, 4.4+ for delete), drivers should allow the option to be specified. They should only report an error for earlier server versions where the server is known to &lt;b&gt;not&lt;/b&gt; support the option and an error would otherwise not be returned because of the nature of unacknowledged writes.&lt;/p&gt;

&lt;p&gt;Previous arguments relating &lt;tt&gt;hint&lt;/tt&gt; to existing treatment of &lt;tt&gt;arrayFilters&lt;/tt&gt; and &lt;tt&gt;collation&lt;/tt&gt; aren&apos;t relevant, because their documentation refers to &quot;unacknowledged writes using OP_UPDATE&quot; (where the option cannot be expressed). Those options don&apos;t refer to OP_MSG at all, because they were both supported by all server versions that support OP_MSG. &lt;tt&gt;hint&lt;/tt&gt; can retain the language about OP_UPDATE, but its OP_MSG language should be revised to only mandate an error on unsupported server versions.&lt;/p&gt;

&lt;p&gt;Lastly, the following &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst#q-a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;Q&amp;amp;A&lt;/a&gt; should be revised:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Q: Why are client-side errors raised when options are provided for unacknowledged write operations, even on server versions that support those options?&lt;br/&gt;
 Even if the server supports an option, that option could be incorrectly formatted or contain outdated information (e.g. a &quot;hint&quot; option referencing an index that no longer exists). This is a problem during unacknowledged writes because the server cannot return an error response to alert the client of an incorrect option. By always raising a client-side error when options are specified for unacknowledged writes, users are prevented from performing operations with options that do not work.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This is a poor argument as incorrectly formatted options can just as easily apply to the filter or update/replacement arguments (e.g. using an invalid query operator). It&apos;s one thing to raise a client-error when the driver knows for certain that a server option is not supported, but the current strategy is presumptive.&lt;/p&gt;

&lt;p&gt;We should also update the language for findAndModify in the CRUD spec (since it does refer to behavior of unacknowledged write concerns). findAndModify support for &lt;tt&gt;hint&lt;/tt&gt; requires 4.4+ (see: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42099&quot; title=&quot;allow passing hint to findAndModify for update operations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42099&quot;&gt;&lt;del&gt;SERVER-42099&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44367&quot; title=&quot;Allow hinting the delete command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44367&quot;&gt;&lt;del&gt;SERVER-44367&lt;/del&gt;&lt;/a&gt;). Although findAndModify always returns a response, an unacknowledged write concern seems to force an {{&lt;/p&gt;
{ok:1}
&lt;p&gt;}} response, which hides any error if &lt;tt&gt;hint&lt;/tt&gt; is unsupported or invalid (e.g. no such index). With respect to this issue, we need only concern ourselves with whether &lt;tt&gt;hint&lt;/tt&gt; is supported, so raising an error if &lt;tt&gt;hint&lt;/tt&gt; is used on a pre-4.4 server with an unacknowledged write concern is sufficient.&lt;/p&gt;
&lt;hr /&gt;
&lt;div class=&quot;panel&quot; style=&quot;background-color: #fafbfc;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;This issue was originally reported after starting work on language tickets for DRIVERS-991, which asked drivers to raise client-side errors for any use of &lt;tt&gt;hint&lt;/tt&gt; with unacknowledged writes. This ticket seeks to revert that change and make an allowance for cases where drivers know that the server does support the &lt;tt&gt;hint&lt;/tt&gt; option. Since DRIVERS-991 was filed, libmongoc and dependent drivers have chosen not to implement that ticket and are instead waiting on this ticket to be resolved. This ticket has languished for more than a year since and remains outstanding.&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;h4&gt;&lt;a name=&quot;Whoistheaffectedenduser%3F&quot;&gt;&lt;/a&gt;Who is the affected end user?&lt;/h4&gt;

&lt;p&gt;Applications that would like to utilize &lt;tt&gt;hint&lt;/tt&gt; options with unacknowledged writes.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Howdoesthisaffecttheenduser%3F&quot;&gt;&lt;/a&gt;How does this affect the end user?&lt;/h4&gt;

&lt;p&gt;The behavior is currently prohibited by our specifications despite being possible to implement. In hindsight, it was premature to add the blanket prohibition.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Howlikelyisitthatthisproblemorusecasewilloccur%3F&quot;&gt;&lt;/a&gt;How likely is it that this problem or use case will occur?&lt;/h4&gt;

&lt;p&gt;A minority of applications make individual use of &lt;tt&gt;hint&lt;/tt&gt; and unacknowledged writes. The intersection of applications using both features together is even rarer.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Iftheproblemdoesoccur%2Cwhataretheconsequencesandhowseverearethey%3F&quot;&gt;&lt;/a&gt;If the problem does occur, what are the consequences and how severe are they?&lt;/h4&gt;

&lt;p&gt;Inability to execute a supported operation.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisissueurgent%3F&quot;&gt;&lt;/a&gt;Is this issue urgent?&lt;/h4&gt;

&lt;p&gt;No.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisticketrequiredbyadownstreamteam%3F&quot;&gt;&lt;/a&gt;Is this ticket required by a downstream team?&lt;/h4&gt;

&lt;p&gt;No.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Isthisticketonlyfortests%3F&quot;&gt;&lt;/a&gt;Is this ticket only for tests?&lt;/h4&gt;

&lt;p&gt;This ticket affects both driver functionality and our spec tests.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="1848963">CXX-2347</key>
            <summary>Allow hint for unacknowledged writes using OP_MSG when supported by the server</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="13201">Fixed</resolution>
                                        <assignee username="ezra.chung@mongodb.com">Ezra Chung</assignee>
                                    <reporter username="backlog-server-pm">Backlog - Core Eng Program Management Team</reporter>
                        <labels>
                    </labels>
                <created>Wed, 11 Aug 2021 15:15:59 +0000</created>
                <updated>Sat, 28 Oct 2023 11:26:51 +0000</updated>
                            <resolved>Tue, 28 Jun 2022 18:29:10 +0000</resolved>
                                                    <fixVersion>3.7.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="4645749" author="xgen-internal-githook" created="Tue, 28 Jun 2022 18:27:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Ezra Chung&apos;, &apos;email&apos;: &apos;88335979+eramongodb@users.noreply.github.com&apos;, &apos;username&apos;: &apos;eramongodb&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CXX-2347&quot; title=&quot;Allow hint for unacknowledged writes using OP_MSG when supported by the server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CXX-2347&quot;&gt;&lt;del&gt;CXX-2347&lt;/del&gt;&lt;/a&gt; Allow hint for unacknowledged writes (#870)&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Sync CRUD spec tests to 59a5dadb&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Revert skipping of unsupported *-hint-clientError tests&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Support unacknowledged bulkWrite result in unified test runner&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Add support for matching fields of string type&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Support unacknowledged findAndModify result&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Assert server support for hint errors as a client error&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Fix missing include directories for test runners&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Bump default C driver version&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-cxx-driver/commit/935001c5e0288a09cef84279633b917d1f0494f1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-cxx-driver/commit/935001c5e0288a09cef84279633b917d1f0494f1&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="1848962">CDRIVER-4127</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10020">
                    <name>Gantt Dependency</name>
                                                                <inwardlinks description="has to be done after">
                                        <issuelink>
            <issuekey id="1684410">CXX-2229</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10620">
                    <name>Issue split</name>
                                                                <inwardlinks description="split from">
                                        <issuelink>
            <issuekey id="1415036">DRIVERS-1340</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="2078849">CXX-2539</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1299865">CXX-1975</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1323049">CXX-2002</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|hzhi9z:</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_21457" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Upstream Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/DRIVERS-1340&quot; title=&quot;Allow hint for unacknowledged writes using OP_MSG when supported by the server&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DRIVERS-1340&quot;&gt;DRIVERS-1340&lt;/a&gt;:&lt;br/&gt;
Drivers should no longer prohibit using &lt;tt&gt;hint&lt;/tt&gt; with an unacknowledged write concern for update, delete, and findAndModify commands (issued via OP_MSG) and related helpers (e.g. UpdateOne, bulkWrite, findOneAndDelete) if &lt;tt&gt;hint&lt;/tt&gt; is known to be supported by the server executing the operation (i.e. 4.2+ for update commands, 4.4+ for delete and findAndModify). Drivers should sync unified CRUD tests with &lt;a href=&quot;https://github.com/mongodb/specifications/commit/59a5dadb2eeab8bba5a7d9a9acd47aa8c1d594cf&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb/specifications@59a5dad&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Drivers (like Java, for example) that ignore unacknowledged write concern for findOneAndReplace/Update/Delete helpers should skip the following tests:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Unacknowledged findOneAndReplace with hint string on 4.4+ server&lt;/li&gt;
	&lt;li&gt;Unacknowledged findOneAndReplace with hint document on 4.4+ server&lt;/li&gt;
	&lt;li&gt;Unacknowledged findOneAndUpdate with hint string on 4.4+ server&lt;/li&gt;
	&lt;li&gt;Unacknowledged findOneAndUpdate with hint document on 4.4+ server&lt;/li&gt;
	&lt;li&gt;Unacknowledged findOneAndDelete with hint string on 4.4+ server&lt;/li&gt;
	&lt;li&gt;Unacknowledged findOneAndDelete with hint document on 4.4+ server&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;because those tests are assuming that the driver includes writeConcern: {w : 0 } in the &lt;tt&gt;findAndModify&lt;/tt&gt; command and that, as a result, the server response with only &lt;tt&gt;ok: 1&lt;/tt&gt; and therefore &lt;tt&gt;value&lt;/tt&gt; is unset.&lt;/p&gt;</customfieldvalue>

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