<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:31:56 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-53817] Remove check for shouldConflictWithSecondaryBatchApplication() in isCollectionLockedForMode()</title>
                <link>https://jira.mongodb.org/browse/SERVER-53817</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;tt&gt;isCollectionLockedForMode()&lt;/tt&gt; has a special case where it always returns true if&#160;&lt;tt&gt;shouldConflictWithSecondaryBatchApplication&lt;/tt&gt; returns false:&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/blob/1522b29e65bffd4c438756e5202aef062410864d/src/mongo/db/concurrency/lock_state.cpp#L630-L631&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/1522b29e65bffd4c438756e5202aef062410864d/src/mongo/db/concurrency/lock_state.cpp#L630-L631&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While we might not need to hold locks in this special mode it causes seemingly confusing behavior where the locker reports that locks are held.&lt;/p&gt;

&lt;p&gt;We have invariants throughout the codebase that checks if Collections are locked in certain modes. Here are a few that would start firing in certain conditions if the &lt;tt&gt;shouldConflictWithSecondaryBatchApplication&lt;/tt&gt; check is removed from &lt;tt&gt;isCollectionLockedForMode&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/3a4dda6f0dc7f32e91310b9256cd3b499f7715d2/src/mongo/db/pipeline/pipeline_d.cpp#L110-L112&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/3a4dda6f0dc7f32e91310b9256cd3b499f7715d2/src/mongo/db/pipeline/pipeline_d.cpp#L110-L112&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/bc41e7992d3c4e84a532e3833623b8e237a281e4/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp#L2458-L2460&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/bc41e7992d3c4e84a532e3833623b8e237a281e4/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp#L2458-L2460&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/bc41e7992d3c4e84a532e3833623b8e237a281e4/src/mongo/db/s/collection_sharding_state.cpp#L120-L121&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/bc41e7992d3c4e84a532e3833623b8e237a281e4/src/mongo/db/s/collection_sharding_state.cpp#L120-L121&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/bc41e7992d3c4e84a532e3833623b8e237a281e4/src/mongo/db/catalog/database_impl.cpp#L529-L530&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/bc41e7992d3c4e84a532e3833623b8e237a281e4/src/mongo/db/catalog/database_impl.cpp#L529-L530&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1590739">SERVER-53817</key>
            <summary>Remove check for shouldConflictWithSecondaryBatchApplication() in isCollectionLockedForMode()</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="gregory.noma@mongodb.com">Gregory Noma</assignee>
                                    <reporter username="henrik.edin@mongodb.com">Henrik Edin</reporter>
                        <labels>
                            <label>auto-reverted</label>
                            <label>techdebt</label>
                    </labels>
                <created>Thu, 14 Jan 2021 22:03:19 +0000</created>
                <updated>Sun, 29 Oct 2023 21:58:47 +0000</updated>
                            <resolved>Fri, 28 Jul 2023 18:39:40 +0000</resolved>
                                                    <fixVersion>7.1.0-rc0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="5599285" author="xgen-internal-githook" created="Fri, 28 Jul 2023 18:38:56 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Gregory Noma&apos;, &apos;email&apos;: &apos;gregory.noma@gmail.com&apos;, &apos;username&apos;: &apos;gregorynoma&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53817&quot; title=&quot;Remove check for shouldConflictWithSecondaryBatchApplication() in isCollectionLockedForMode()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53817&quot;&gt;&lt;del&gt;SERVER-53817&lt;/del&gt;&lt;/a&gt; Remove confusing condition when checking collection lock&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/49ef575375b966620f26bfbac71edb768427a73c&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/49ef575375b966620f26bfbac71edb768427a73c&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5597522" author="xgen-buildbaron-user" created="Fri, 28 Jul 2023 07:55:10 +0000"  >&lt;p&gt;Ticket re-opened due to revert. &lt;a href=&quot;https://evergreen.mongodb.com/task/mongodb_mongo_master_rhel80_debug_aubsan_all_feature_flags_change_streams_multitenant_passthrough_7361e4e5bf9758705fb46c2cc022defa22c4042f_23_07_27_12_34_32&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;change_streams_multitenant_passthrough&lt;/a&gt; began a consistent failure of jstests/change_streams/pipeline_style_updates.js&lt;/p&gt;</comment>
                            <comment id="5597521" author="xgen-internal-githook" created="Fri, 28 Jul 2023 07:52:30 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;auto-revert-processor&apos;, &apos;email&apos;: &apos;dev-prod-dag@mongodb.com&apos;, &apos;username&apos;: &apos;&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53817&quot; title=&quot;Remove check for shouldConflictWithSecondaryBatchApplication() in isCollectionLockedForMode()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53817&quot;&gt;&lt;del&gt;SERVER-53817&lt;/del&gt;&lt;/a&gt; Remove confusing condition when checking collection lock&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit 7361e4e5bf9758705fb46c2cc022defa22c4042f.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ef8504eefef4c9fe2062b8424e85053b3e1ad8d2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ef8504eefef4c9fe2062b8424e85053b3e1ad8d2&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5595133" author="xgen-internal-githook" created="Thu, 27 Jul 2023 12:34:36 +0000"  >&lt;p&gt;Author: &lt;/p&gt;
{&apos;name&apos;: &apos;Gregory Noma&apos;, &apos;email&apos;: &apos;gregory.noma@gmail.com&apos;, &apos;username&apos;: &apos;gregorynoma&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53817&quot; title=&quot;Remove check for shouldConflictWithSecondaryBatchApplication() in isCollectionLockedForMode()&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53817&quot;&gt;&lt;del&gt;SERVER-53817&lt;/del&gt;&lt;/a&gt; Remove confusing condition when checking collection lock&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/7361e4e5bf9758705fb46c2cc022defa22c4042f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/7361e4e5bf9758705fb46c2cc022defa22c4042f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="5590264" author="JIRAUSER1264163" created="Tue, 25 Jul 2023 16:18:17 +0000"  >&lt;p&gt;We set the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/348fa10364894cbd598ea58112a43b4d7cecf215/src/mongo/db/service_entry_point_common.cpp#L713&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;flag for shouldConflictWithSecondaryBatchApplication to false&lt;/a&gt; on multi-document transactions as well. I didn&apos;t know this ticket existed and filed &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-77474&quot; title=&quot;LockerImpl::isCollectionLockedForMode always returns true in multi-document transactions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-77474&quot;&gt;&lt;del&gt;SERVER-77474&lt;/del&gt;&lt;/a&gt; for this.&lt;/p&gt;</comment>
                            <comment id="3602141" author="dianna.hohensee" created="Fri, 5 Feb 2021 17:56:08 +0000"  >&lt;p&gt;Copying this here, as it is enlightening about why this lock bypass exists:&lt;/p&gt;

&lt;p&gt;&quot;Apparently, for secondary oplog application, the writer threads expect the main applier thread to hold locks for them. The main applier thread runs X lock operations serially, so no other writers are active in the system. Therefore, &lt;tt&gt;isCollectionLockedForMode&lt;/tt&gt;&#160;returns &lt;tt&gt;true&lt;/tt&gt;&#160;if &lt;tt&gt;shouldConflictWithSecondaryBatchApplication==false&lt;/tt&gt;&#160;as a signal that is what is happening.&quot;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="1592660">SERVER-53846</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2400422">SERVER-79319</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2400431">SERVER-79320</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2400484">SERVER-79322</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2400500">SERVER-79323</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2400746">SERVER-79343</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2400760">SERVER-79344</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2400962">SERVER-79345</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2400965">SERVER-79346</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2400970">SERVER-79347</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2400982">SERVER-79348</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2402110">SERVER-79399</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="2350477">SERVER-77474</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                            <outwardlinks description="causes">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</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="25136"><![CDATA[Storage Execution]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 5 Feb 2021 17:18:04 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        27 weeks, 5 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-53846'>SERVER-53846</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-79319'>SERVER-79319</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-79320'>SERVER-79320</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-79322'>SERVER-79322</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-79323'>SERVER-79323</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-79343'>SERVER-79343</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-79344'>SERVER-79344</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-79345'>SERVER-79345</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-79346'>SERVER-79346</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-79347'>SERVER-79347</a></s>, <s><a href='https://jira.mongodb.org/browse/SERVER-79348'>SERVER-79348</a></s>]]></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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-2170</customfieldvalue>
                        </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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            27 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>169.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>dianna.hohensee@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>gregory.noma@mongodb.com</customfieldvalue>
            <customfieldvalue>henrik.edin@mongodb.com</customfieldvalue>
            <customfieldvalue>jordi.olivares-provencio@mongodb.com</customfieldvalue>
            <customfieldvalue>Xgen-BuildBaron-User</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hypmpj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i1yd8s:w</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_22250" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Special Downgrade Instructions Required</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="23343"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="7182">Execution NAMR Team 2023-08-07</customfieldvalue>

                        </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|hyp8yv:</customfieldvalue>

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