<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:37:17 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-78035] Cluster wide read/write concern are incorrectly applied for reads/writes to non-replicated namespaces</title>
                <link>https://jira.mongodb.org/browse/SERVER-78035</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I think this issue likely dates back to 4.4 when cluster-wide read/write concern support was added. See &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; for some previous discussion on this. Back then, we opted not to try to avoid applying the RC/WC in this case due to difficulty knowing which namespaces a command would touch. Instead, we opted to require an explicit RC/WC for all internal operations. However, this leaves external commands interacting with non-replicated collections vulnerable to this bug. &lt;/p&gt;

&lt;p&gt;The impact of this:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;For writes, I don&apos;t believe there is an impact, other than that we confusingly emit a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/2251e0e954ca431978a989de49a0c32e26fd5d47/src/mongo/db/write_concern.cpp#L115-L121&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;debug log&lt;/a&gt; &quot;applying default writeConcern&quot; for the operation. &lt;tt&gt;ServiceEntryPointMongod::Hooks::waitForWriteConcern&lt;/tt&gt; ultimately checks if the namespace is unreplicated and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/2251e0e954ca431978a989de49a0c32e26fd5d47/src/mongo/db/service_entry_point_mongod.cpp#L117-L121&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;no-ops&lt;/a&gt; if so.&lt;/li&gt;
	&lt;li&gt;For reads, I think in most cases there is also little impact besides confusing &lt;a href=&quot;https://github.com/mongodb/mongo/blob/2251e0e954ca431978a989de49a0c32e26fd5d47/src/mongo/db/service_entry_point_common.cpp#L289-L295&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;logs&lt;/a&gt;. If a cluster-wide majority RC is set, so long as there is some majority committed snapshot available already, we will successfully &quot;wait&quot; for read concern. However, in certain situations (such as if no majority committed snapshot exists yet and a majority of nodes are down) we could hang indefinitely waiting for one to become available. The only other allowed cluster-wide read concern levels are &quot;available&quot; and &quot;local&quot;, and if I understand those correctly in neither case would we actually wait for anything.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The ideal behavior seems like it should be:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;If no read/write concern is supplied for the operation, we do not apply the cluster-wide default.&lt;/li&gt;
	&lt;li&gt;If a read/write concern is supplied for the operation, we ignore it (and also do not apply the cluster-wide default). Arguably the most correct behavior could be to error.  However, drivers support setting client-wide read and write concerns that are applied to each operation (and drivers do not know or check whether a namespace is replicated before applying the RC/WC), and so I think we may break applications relying on us ignoring/effectively ignoring the value when they upgrade, if we were to start erroring.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;There is a straightforward workaround, which is to explicitly specify the correct read/write concern for any operations that are failing due to the incorrectly applied default. When an explicit read/write concern is specified, we do not apply the default.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2366783">SERVER-78035</key>
            <summary>Cluster wide read/write concern are incorrectly applied for reads/writes to non-replicated namespaces</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-server-repl">Backlog - Replication Team</assignee>
                                    <reporter username="kaitlin.mahar@mongodb.com">Kaitlin Mahar</reporter>
                        <labels>
                    </labels>
                <created>Tue, 13 Jun 2023 14:54:14 +0000</created>
                <updated>Wed, 21 Jun 2023 17:17:50 +0000</updated>
                                                                                                <votes>0</votes>
                                    <watches>10</watches>
                                                                                                                <comments>
                            <comment id="5495709" author="kaitlin.mahar" created="Tue, 13 Jun 2023 15:54:57 +0000"  >&lt;p&gt;Attached a basic test whose log output shows this behavior.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="455894" name="cw_rc_wc_unreplicated_ns.js" size="1828" author="kaitlin.mahar@mongodb.com" created="Tue, 13 Jun 2023 15:54:44 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.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>
                                        34 weeks, 1 day 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>kaitlin.mahar@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            34 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-repl</customfieldvalue>
            <customfieldvalue>kaitlin.mahar@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i2dmfb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1vu2o:</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_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|i2d8kn:</customfieldvalue>

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