<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:16:18 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-2775] mongoc_collection_find_with_opts prefers collection readConcern to the one in &quot;opts&quot;</title>
                <link>https://jira.mongodb.org/browse/CDRIVER-2775</link>
                <project id="10030" key="CDRIVER">C Driver</project>
                    <description>&lt;p&gt;If the user provides a readConcern in &quot;opts&quot; it should take precedence over the collection&apos;s readConcern. However, mongoc_collection_find_with_opts prefers the wrong readConcern.&lt;/p&gt;</description>
                <environment></environment>
        <key id="577674">CDRIVER-2775</key>
            <summary>mongoc_collection_find_with_opts prefers collection readConcern to the one in &quot;opts&quot;</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="jesse@mongodb.com">A. Jesse Jiryu Davis</assignee>
                                    <reporter username="jesse@mongodb.com">A. Jesse Jiryu Davis</reporter>
                        <labels>
                    </labels>
                <created>Fri, 27 Jul 2018 19:26:47 +0000</created>
                <updated>Sat, 28 Oct 2023 11:29:40 +0000</updated>
                            <resolved>Mon, 30 Jul 2018 13:49:24 +0000</resolved>
                                                    <fixVersion>1.13.0</fixVersion>
                                    <component>libmongoc</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1960335" author="xgen-internal-githook" created="Mon, 30 Jul 2018 16:09:29 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;ajdavis&apos;, &apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;email&apos;: &apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2775&quot; title=&quot;mongoc_collection_find_with_opts prefers collection readConcern to the one in &amp;quot;opts&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2775&quot;&gt;&lt;del&gt;CDRIVER-2775&lt;/del&gt;&lt;/a&gt; test readConcern inheritance in txn&lt;/p&gt;

&lt;p&gt;Additional test that sets a collection-level readConcern and passes a&lt;br/&gt;
readConcern to mongoc_collection_find_with_opts; the operation should&lt;br/&gt;
still fail because explicit readConcern is prohibited in transaction.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/72063936b975fc2e5745455065196ccebee63271&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/72063936b975fc2e5745455065196ccebee63271&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1959244" author="xgen-internal-githook" created="Sat, 28 Jul 2018 02:34:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;username&apos;: &apos;ajdavis&apos;, &apos;name&apos;: &apos;A. Jesse Jiryu Davis&apos;, &apos;email&apos;: &apos;jesse@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2775&quot; title=&quot;mongoc_collection_find_with_opts prefers collection readConcern to the one in &amp;quot;opts&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2775&quot;&gt;&lt;del&gt;CDRIVER-2775&lt;/del&gt;&lt;/a&gt; find prefers readConcern from opts&lt;/p&gt;

&lt;p&gt;Don&apos;t use the collection&apos;s readConcern if there is a &quot;readConcern&quot; key&lt;br/&gt;
in &quot;opts&quot;.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-c-driver/commit/2edd3b2a91171a5da88e9282ffb6a3efbbc2bd91&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-c-driver/commit/2edd3b2a91171a5da88e9282ffb6a3efbbc2bd91&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1959222" author="jesse" created="Fri, 27 Jul 2018 23:45:44 +0000"  >&lt;p&gt;We introduced mongoc_collection_find_with_opts in 1.5.0 and said that readConcern would be prohibited in opts (&lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-1522&quot; title=&quot;Add mongoc_collection_find_with_opts&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-1522&quot;&gt;&lt;del&gt;CDRIVER-1522&lt;/del&gt;&lt;/a&gt;), although that wasn&apos;t enforced client-side. In fact, if readConcern is provided in opts then mongoc_collection_find_with_opts would use it, and if readConcern was &lt;b&gt;also&lt;/b&gt; set on the collection then mongoc_collection_find_with_opts would send both, causing a server side &quot;duplicate field&quot; error. (Don&apos;t know for how long the server has been checking for duplicates.)&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;readConcern: {level: &apos;foo&apos;}, readConcern: {level: &apos;bar&apos;}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;That changed in 1.10.0 when we released cursor code that was refactored in &lt;a href=&quot;https://jira.mongodb.org/browse/CDRIVER-2502&quot; title=&quot;Rewrite mongoc_cursor_t&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CDRIVER-2502&quot;&gt;&lt;del&gt;CDRIVER-2502&lt;/del&gt;&lt;/a&gt;. After that we passed both readConcern levels:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;readConcern: {level: &apos;foo&apos;, level: &apos;bar&apos;}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;In 1.11.0 as part of readConcern updates for transactions, that changed again and we now pass a single readConcern level, but it&apos;s the wrong one: the collection&apos;s.&lt;/p&gt;

&lt;p&gt;Before this is closed I must also test that if readConcern is set on the collection and passed in &apos;opts&apos; and we&apos;re in a transaction, it&apos;s a client-side error.&lt;/p&gt;</comment>
                            <comment id="1959001" author="jmikola@gmail.com" created="Fri, 27 Jul 2018 19:38:26 +0000"  >&lt;p&gt;&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;: What&apos;s the affected version of this bug? I assume it dates back to whenever a &lt;tt&gt;readConcern&lt;/tt&gt; option was first introduced to &lt;tt&gt;mongoc_collection_find_with_opts()&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=derick&quot; class=&quot;user-hover&quot; rel=&quot;derick&quot;&gt;derick&lt;/a&gt;: FYI, this isn&apos;t a problem for PHPC as we &lt;a href=&quot;https://github.com/mongodb/mongo-php-driver/blob/1.5.1/php_phongo.c#L776&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;apply the Query&apos;s read concern directly to the collection&lt;/a&gt;. It may be worth having a ticket to refactor that once we bump to libmongoc 1.13, though, as relying on &lt;tt&gt;mongoc_collection_find_with_opts()&lt;/tt&gt; would allow us to handle the option consistently with other Query options.&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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>CDRIVER-2778</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htuckf:</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>