<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:30:29 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>[SERVER-53293] DBClientCursor not properly applying readConcern when passed in as an argument</title>
                <link>https://jira.mongodb.org/browse/SERVER-53293</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;We use DBClientCursor to facilitate many of the calls supported by the DBClientBase interface (eg. &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d13b8b8906ea017d5f015b3df8e644895dcdbff2/src/mongo/client/dbclient_base.cpp#L813&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;DBClientBase::query&lt;/a&gt;). DBClientCursor accepts a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d13b8b8906ea017d5f015b3df8e644895dcdbff2/src/mongo/client/dbclient_cursor.cpp#L530&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;readConcernObj as an optional argument&lt;/a&gt;. However, the readConcernObj passed in will always be overwritten to be empty due to the following:&lt;br/&gt;
1. As part of initiating the DBClientCursor object, we use the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d13b8b8906ea017d5f015b3df8e644895dcdbff2/src/mongo/client/dbclient_cursor.cpp#L123&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;legacy parsing code&lt;/a&gt; supplied by QueryRequest.&lt;br/&gt;
2. This calls QueryRequest::init with &lt;tt&gt;fromQueryMessage&lt;/tt&gt; &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d13b8b8906ea017d5f015b3df8e644895dcdbff2/src/mongo/db/query/query_request.cpp#L730&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;always set to true&lt;/a&gt;.&lt;br/&gt;
3. We will always initialize the query message with &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d13b8b8906ea017d5f015b3df8e644895dcdbff2/src/mongo/db/query/query_request.cpp#L785-L788&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;an empty readConcern&lt;/a&gt;.&lt;br/&gt;
4. When trying to parse the QueryRequest &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d13b8b8906ea017d5f015b3df8e644895dcdbff2/src/mongo/client/dbclient_cursor.cpp#L150&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;as a findCommand&lt;/a&gt;, we will always have a readConcern field with &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d13b8b8906ea017d5f015b3df8e644895dcdbff2/src/mongo/db/query/query_request.cpp#L444-L446&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;an empty value&lt;/a&gt;.&lt;br/&gt;
5. The parsed cmd will always have a readConcern field (but the value itself will always be empty) so we never actually enter &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d13b8b8906ea017d5f015b3df8e644895dcdbff2/src/mongo/client/dbclient_cursor.cpp#L156-L160&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this conditional&lt;/a&gt; to append the passed in readConcernObj.&lt;/p&gt;

&lt;p&gt;Since we use DBClientCursor for many of our DBClientConnection and DBDirectClient calls, having a readConcern field that doesn&apos;t actually append the readConcern is very misleading. Instead we should add an invariant to ensure that no readConcernObj is passed into DBClientCursor. We should also investigate whether the optional argument can be removed altogether.&lt;/p&gt;

&lt;p&gt;We already have a similar invariant for &lt;a href=&quot;https://github.com/mongodb/mongo/blob/d13b8b8906ea017d5f015b3df8e644895dcdbff2/src/mongo/db/dbdirectclient.cpp#L172&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;DBDirectClient::query&lt;/a&gt; but we should probably move it further down the chain to avoid confusion.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1563410">SERVER-53293</key>
            <summary>DBClientCursor not properly applying readConcern when passed in as an argument</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="backlog-server-repl">Backlog - Replication Team</assignee>
                                    <reporter username="jason.chan@mongodb.com">Jason Chan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 9 Dec 2020 04:38:11 +0000</created>
                <updated>Tue, 6 Dec 2022 01:42:03 +0000</updated>
                            <resolved>Thu, 10 Dec 2020 00:29:12 +0000</resolved>
                                    <version>4.9 Required</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3524316" author="jason.chan" created="Thu, 10 Dec 2020 00:29:12 +0000"  >&lt;p&gt;This fix will be addressed as part of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50985&quot; title=&quot;Tenant collection cloner query must use readConcern majority&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50985&quot;&gt;&lt;del&gt;SERVER-50985&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3523640" author="jason.chan" created="Wed, 9 Dec 2020 19:33:15 +0000"  >&lt;p&gt;From &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45692&quot; title=&quot;Ensure all internal inter-node commands which accept read/write concern explicitly specify it&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45692&quot;&gt;&lt;del&gt;SERVER-45692&lt;/del&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;The approach will be to add a uassert/fassert (or possibly fassert when enableTestCommands, else uassert) if mongod receives an incoming command, on an internalClient connection, that accepts RWC, but doesn&apos;t have it explicitly specified. The reason is that without it being explicitly specified, this internal command would have the user-defined CWRWC default applied to it, which may not give the desired semantics. This will also ensure that future inter-node communication includes explicit RWC as appropriate (because otherwise tests will fail).&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;This explains that we want an explicit readConcern to be passed from internal clients (but not DBDirectClient, which is why we have the invariant described). This leads me to believe this is actually a bug that we are unable to pass in a non-empty readconcern to DBClientConnection calls that use DBClientCursor.&lt;/p&gt;</comment>
                            <comment id="3522319" author="jason.chan" created="Wed, 9 Dec 2020 04:51:58 +0000"  >&lt;p&gt;Adding an invariant will also serve as an audit of our code for places where we might not be using the readConcern that we expect when making DBClient calls.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="1477668">SERVER-50985</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1477668">SERVER-50985</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1563413">SERVER-53294</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1108320">SERVER-45692</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25128"><![CDATA[Replication]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 9 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></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_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 9 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-repl</customfieldvalue>
            <customfieldvalue>jason.chan@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyl03z:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hy6w47:</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_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hykmdb:</customfieldvalue>

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