<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:14:32 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-2214] Throw errors in collection functions that write/read when a write/read concern is specified and maxWireVersion &lt; 5</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2214</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;From the read/write concern spec:&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Command helper methods for commands that write, other than those discussed above, MAY accept a write concern or write concern options in their parameter list. If the helper accepts a write concern, the driver MUST error if the selected server&apos;s MaxWireVersion &amp;lt; 5 and a write concern has explicitly been specified.&lt;/p&gt;

&lt;p&gt;Helper methods that apply the write concern inherited from the Collection or Database, SHOULD check whether the selected server&apos;s MaxWireVersion &amp;gt;= 5 and if so, include the inherited write concern in the command on the wire. If the selected server&apos;s MaxWireVersion &amp;lt; 5, these methods SHOULD silently omit the write concern from the command on the wire.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The specific sentence the C Driver violates is: &quot;If the helper accepts a write concern, the driver MUST error if the selected server&apos;s MaxWireVersion &amp;lt; 5 and a write concern has explicitly been specified.&quot;&lt;/p&gt;

&lt;p&gt;Most of the commands implement the second paragraph from the spec, but do not error out if one passes the write concern in via the options document. (e.g. collection_aggregate_with_opts). These commands should be changed so that if a writeConcern is passed in and maxWireVersion &amp;lt; 5, the driver will throw an error.&lt;/p&gt;

&lt;p&gt;Full list of these helper commands:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;aggregate with $out&lt;/li&gt;
	&lt;li&gt;copydb&lt;/li&gt;
	&lt;li&gt;create&lt;/li&gt;
	&lt;li&gt;createIndexes&lt;/li&gt;
	&lt;li&gt;drop&lt;/li&gt;
	&lt;li&gt;dropDatabase&lt;/li&gt;
	&lt;li&gt;dropIndexes&lt;/li&gt;
	&lt;li&gt;mapReduce with $out&lt;/li&gt;
	&lt;li&gt;clone&lt;/li&gt;
	&lt;li&gt;cloneCollection&lt;/li&gt;
	&lt;li&gt;cloneCollectionAsCapped&lt;/li&gt;
	&lt;li&gt;collMod&lt;/li&gt;
	&lt;li&gt;convertToCapped&lt;/li&gt;
	&lt;li&gt;renameCollection&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Likewise for readConcern, the spec says: &lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Only the server&#8217;s default ReadConcern is support by MaxWireVersion &amp;lt; 4. When using other readConcernLevels with clients reporting MaxWireVersion &amp;lt; 4, the driver MUST raise an error. &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The driver implements this properly for aggregate_with_opts, but only silently fails with count, and does not seem to check at all for collection_find_with_opts.&lt;/p&gt;</description>
                <environment></environment>
        <key id="405724">CDRIVER-2214</key>
            <summary>Throw errors in collection functions that write/read when a write/read concern is specified and maxWireVersion &lt; 5</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="patrick.freed@mongodb.com">Patrick Freed</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 Jul 2017 19:37:22 +0000</created>
                <updated>Sat, 28 Oct 2023 11:30:35 +0000</updated>
                            <resolved>Tue, 9 Jan 2018 20:55:01 +0000</resolved>
                                                    <fixVersion>1.10.0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1771743" author="xgen-internal-githook" created="Thu, 11 Jan 2018 17:34:22 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2214&quot; title=&quot;Throw errors in collection functions that write/read when a write/read concern is specified and maxWireVersion &amp;lt; 5&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2214&quot;&gt;&lt;del&gt;CDRIVER-2214&lt;/del&gt;&lt;/a&gt; invalid free if aggregate fails&lt;/p&gt;

&lt;p&gt;If aggregate is called with readConcern and the server is too old to&lt;br/&gt;
support it, aggregate returns early. Make sure the reply BSON is always&lt;br/&gt;
initialized, even with an early return.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/2dc5e4ab7ddb7e0b93eab09fc8d4adf98a983856&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/2dc5e4ab7ddb7e0b93eab09fc8d4adf98a983856&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1770437" author="xgen-internal-githook" created="Wed, 10 Jan 2018 17:45:13 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2214&quot; title=&quot;Throw errors in collection functions that write/read when a write/read concern is specified and maxWireVersion &amp;lt; 5&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2214&quot;&gt;&lt;del&gt;CDRIVER-2214&lt;/del&gt;&lt;/a&gt; leak in read concern test&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/44eb0983f78f24a4770c8b8c3cf83094050d4c6b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/44eb0983f78f24a4770c8b8c3cf83094050d4c6b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1769680" author="xgen-internal-githook" created="Tue, 9 Jan 2018 22:18:03 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;email&apos;: &apos;jesse@mongodb.com&apos;, &apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;username&apos;: &apos;ajdavis&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2214&quot; title=&quot;Throw errors in collection functions that write/read when a write/read concern is specified and maxWireVersion &amp;lt; 5&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2214&quot;&gt;&lt;del&gt;CDRIVER-2214&lt;/del&gt;&lt;/a&gt; prohibit read/writeConcern w/ old server&lt;/p&gt;

&lt;p&gt;Commands that write now conform to the drivers spec: it is an error to&lt;br/&gt;
supply an explicit write concern if MongoDB is too old to support it.&lt;/p&gt;

&lt;p&gt;Commands that read now conform to the spec as well: it is an error to&lt;br/&gt;
supply an explicit read concern &lt;b&gt;or&lt;/b&gt; to inherit a read concern from the&lt;br/&gt;
client, database, or collection, if MongoDB is too old to support read&lt;br/&gt;
concern.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/5c88fde8bbf941a115b7de89b95f380ac636b318&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/5c88fde8bbf941a115b7de89b95f380ac636b318&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1767711" author="jesse" created="Mon, 8 Jan 2018 16:32:01 +0000"  >&lt;p&gt;I&apos;ll start with enforcing the writeConcern wire version check.&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;aggregate with $out - done&lt;/li&gt;
	&lt;li&gt;copydb - no helper, users should use mongoc_client_write_command_with_opts, which I&apos;ve fixed and tested&lt;/li&gt;
	&lt;li&gt;create - no helper&lt;/li&gt;
	&lt;li&gt;createIndexes - deprecated helper which doesn&apos;t accept write concern, users are instructed to use mongoc_client/db/collection_write_command_with_opts&lt;/li&gt;
	&lt;li&gt;drop - mongoc_collection_drop_with_opts uses _mongoc_client_command_with_opts, fixed and tested&lt;/li&gt;
	&lt;li&gt;dropDatabase - mongoc_database_drop_with_opts uses _mongoc_client_command_with_opts, no additional test&lt;/li&gt;
	&lt;li&gt;dropIndexes - mongoc_collection_drop_index_with_opts uses _mongoc_client_command_with_opts, no additional test&lt;/li&gt;
	&lt;li&gt;mapReduce with $out - no helper&lt;/li&gt;
	&lt;li&gt;clone - no helper&lt;/li&gt;
	&lt;li&gt;cloneCollection - no helper&lt;/li&gt;
	&lt;li&gt;cloneCollectionAsCapped - no helper&lt;/li&gt;
	&lt;li&gt;collMod - no helper&lt;/li&gt;
	&lt;li&gt;convertToCapped - no helper&lt;/li&gt;
	&lt;li&gt;renameCollection - mongoc_collection_rename_with_opts uses _mongoc_client_command_with_opts, no additional test&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="1625606" author="jesse" created="Tue, 18 Jul 2017 20:02:13 +0000"  >&lt;p&gt;Thanks for the report!&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10020">
                    <name>Gantt Dependency</name>
                                            <outwardlinks description="has to be done before">
                                        <issuelink>
            <issuekey id="388449">CXX-1349</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="718889">PHPC-1350</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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="10011"><![CDATA[Minor Change]]></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|ht32af:</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>