<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:51:50 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-39372] Make secondary lock acquisition for DDL operations consistent with behavior on primary</title>
                <link>https://jira.mongodb.org/browse/SERVER-39372</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently, DDL operations except &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8cbbac8636b5cfae5dd84f308ca9092b0da8b549/src/mongo/db/repl/sync_tail.cpp#L372&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;createIndexes&lt;/a&gt;&#160;acquires Global X lock on the secondary. This causes a problem described in the comments of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39096&quot; title=&quot;Prepared transactions and DDL operations can deadlock on a secondary, if a reader blocks on a prepared document&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39096&quot;&gt;&lt;del&gt;SERVER-39096&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="683624">SERVER-39372</key>
            <summary>Make secondary lock acquisition for DDL operations consistent with behavior on primary</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="xiangyu.yao@mongodb.com">Xiangyu Yao</assignee>
                                    <reporter username="xiangyu.yao@mongodb.com">Xiangyu Yao</reporter>
                        <labels>
                    </labels>
                <created>Mon, 4 Feb 2019 21:16:52 +0000</created>
                <updated>Sun, 29 Oct 2023 22:24:26 +0000</updated>
                            <resolved>Mon, 4 Mar 2019 15:34:51 +0000</resolved>
                                                    <fixVersion>4.1.9</fixVersion>
                                    <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="2167995" author="xgen-internal-githook" created="Fri, 1 Mar 2019 21:31:16 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Xiangyu Yao&apos;, &apos;username&apos;: &apos;xy24&apos;, &apos;email&apos;: &apos;xiangyu.yao@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39372&quot; title=&quot;Make secondary lock acquisition for DDL operations consistent with behavior on primary&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39372&quot;&gt;&lt;del&gt;SERVER-39372&lt;/del&gt;&lt;/a&gt; Make secondary lock acquisition for DDL operations consistent with behavior on primary&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/9b596d485e5be0cb65bef50343ab98db9ed09c2a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/9b596d485e5be0cb65bef50343ab98db9ed09c2a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2147696" author="geert.bosch" created="Wed, 13 Feb 2019 19:11:17 +0000"  >&lt;p&gt;Not by itself at this point, as index creation still takes DB locks. We&apos;re working on making those locks more granular separately. So this ticket is necessary but not sufficient.&lt;/p&gt;</comment>
                            <comment id="2145079" author="max.hirschhorn@10gen.com" created="Mon, 11 Feb 2019 20:45:55 +0000"  >&lt;blockquote&gt;
&lt;p&gt;Max Hirschhorn, will the above approach solve the secondary snapshot reads needs of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39321&quot; title=&quot;Re-enable the CheckReplDBHashInBackground hook&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39321&quot;&gt;&lt;del&gt;SERVER-39321&lt;/del&gt;&lt;/a&gt;?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=judah.schvimer&quot; class=&quot;user-hover&quot; rel=&quot;judah.schvimer&quot;&gt;judah.schvimer&lt;/a&gt;, I haven&apos;t really been following along so I would defer to Geert.&lt;/p&gt;</comment>
                            <comment id="2144890" author="judah.schvimer" created="Mon, 11 Feb 2019 19:18:23 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=max.hirschhorn&quot; class=&quot;user-hover&quot; rel=&quot;max.hirschhorn&quot;&gt;max.hirschhorn&lt;/a&gt;, will the above approach solve the secondary snapshot reads needs of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39321&quot; title=&quot;Re-enable the CheckReplDBHashInBackground hook&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39321&quot;&gt;&lt;del&gt;SERVER-39321&lt;/del&gt;&lt;/a&gt;?&lt;/p&gt;</comment>
                            <comment id="2142978" author="geert.bosch" created="Fri, 8 Feb 2019 20:26:57 +0000"  >&lt;p&gt;That goes exactly in the direction that we want to go, and may indeed be the simplest approach to fixing this issue. I&apos;m in favor.&lt;/p&gt;</comment>
                            <comment id="2142959" author="milkie" created="Fri, 8 Feb 2019 20:17:46 +0000"  >&lt;p&gt;I am in favor of it; I would like &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=geert.bosch&quot; class=&quot;user-hover&quot; rel=&quot;geert.bosch&quot;&gt;geert.bosch&lt;/a&gt;&apos;s opinion as well before proceeding.&lt;/p&gt;</comment>
                            <comment id="2142837" author="judah.schvimer" created="Fri, 8 Feb 2019 19:09:13 +0000"  >&lt;p&gt;Ok, so the final proposal is this ticket, plus removing the unsynchronized strong lock from index builds, plus &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39235&quot; title=&quot;Support SE-based 2-phase drop for SE&amp;#39;s not supporting recoveryToTimestamp&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39235&quot;&gt;&lt;del&gt;SERVER-39235&lt;/del&gt;&lt;/a&gt;? I am on board with that if no one else sees a problem.&lt;/p&gt;</comment>
                            <comment id="2142774" author="milkie" created="Fri, 8 Feb 2019 18:30:02 +0000"  >&lt;p&gt;Only replication two-phase-drops does this, and that I believe is only in use for enableReadConcernMajority:false.  &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39235&quot; title=&quot;Support SE-based 2-phase drop for SE&amp;#39;s not supporting recoveryToTimestamp&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39235&quot;&gt;&lt;del&gt;SERVER-39235&lt;/del&gt;&lt;/a&gt; is planned as a quickwin to eliminate use of replication two-phase drops.&lt;/p&gt;</comment>
                            <comment id="2142745" author="judah.schvimer" created="Fri, 8 Feb 2019 18:13:11 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt;, that sounds good to me. Are there other unsynchronized lock acquisitions? Does two phase drops do this?&lt;/p&gt;</comment>
                            <comment id="2142695" author="milkie" created="Fri, 8 Feb 2019 17:39:51 +0000"  >&lt;p&gt;A fourth option is to remove the unsynchronized strong lock from the index builds.  It is currently expected to be needed in order to make a durable catalog change indicating the change of phase from collection scan to drain mode.  Instead, I believe we can use the presence of the vote document to determine which phase we are in; writing the vote document needs nothing more than intent locks.  To round out this solution, in addition to this change, we would also remove the global lock from the replication applier code path for commands.&lt;/p&gt;</comment>
                            <comment id="2142419" author="judah.schvimer" created="Fri, 8 Feb 2019 15:07:03 +0000"  >&lt;p&gt;I think that if only the unsynchronized lock acquisitions are &lt;tt&gt;compatibleFirst&lt;/tt&gt; then we are guaranteed to make progress once the final synchronized lock acquisition queues up and prevents new reads from jumping it in line.&lt;/p&gt;</comment>
                            <comment id="2142283" author="milkie" created="Fri, 8 Feb 2019 13:45:29 +0000"  >&lt;p&gt;I&apos;m not sure option 3 is viable &amp;#8211; it would mean that a user could indefinitely delay an index build with a heavy read workload on the same collection, and eventually it could even stall replication on that node.&lt;/p&gt;</comment>
                            <comment id="2141822" author="judah.schvimer" created="Thu, 7 Feb 2019 22:31:39 +0000"  >&lt;p&gt;I personally am fine with all three solutions and see no problems, though investigation is necessary into any other unsynchronized lock acquisitions.&lt;/p&gt;

&lt;p&gt;My preference order, given my understanding that the implementation for all three fall on the Storage Team, is 2,1,3. That said, that is almost certainly in reverse order of difficulty.&lt;/p&gt;</comment>
                            <comment id="2141819" author="judah.schvimer" created="Thu, 7 Feb 2019 22:28:49 +0000"  >&lt;p&gt;I spoke with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=geert.bosch&quot; class=&quot;user-hover&quot; rel=&quot;geert.bosch&quot;&gt;geert.bosch&lt;/a&gt; about this and we think we have 3 options going forward:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Complete &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-39096&quot; title=&quot;Prepared transactions and DDL operations can deadlock on a secondary, if a reader blocks on a prepared document&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39096&quot;&gt;&lt;del&gt;SERVER-39096&lt;/del&gt;&lt;/a&gt; and yield locks during prepare conflict retry. This is non-trivial due to the storage/query integration and undesirable to the Storage Team&lt;/li&gt;
	&lt;li&gt;Do this ticket as scoped and synchronize the currently unsynchronized  lock acquisitions in Simultaneous Index Builds. Any other unsynchronized locks in other commands likely also need to be synchronized. &lt;tt&gt;drop&lt;/tt&gt; is the only one I can think of. This is potentially a very large change to Simultaneous Index Builds (and maybe two phase drops), but would be the ideal solution for the replication system. CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=dianna.hohensee&quot; class=&quot;user-hover&quot; rel=&quot;dianna.hohensee&quot;&gt;dianna.hohensee&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=milkie&quot; class=&quot;user-hover&quot; rel=&quot;milkie&quot;&gt;milkie&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;Do this ticket as scoped and make the unsynchronized lock acquisitions &lt;tt&gt;compatibleFirst&lt;/tt&gt; on secondaries. This means that they will not block secondary oplog application from making progress, and in the worst case will occur when secondary oplog application goes to apply the final synchronization point of the Simultaneous Index Build. We also must consider other commands with unsychronized lock acquisitions and if the same solution can and needs to be applied. This solution seems like a good middle ground which allows the secondary to naturally acquire its locks when the primary acquired them without synchronizing them explicitly, but also guarantee forward progress (at least for index builds).&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;If you have any thoughts, preferences, or concerns, please weigh in.&lt;/p&gt;</comment>
                            <comment id="2137464" author="judah.schvimer" created="Mon, 4 Feb 2019 22:26:39 +0000"  >&lt;p&gt;Speaking with &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=siyuan.zhou&quot; class=&quot;user-hover&quot; rel=&quot;siyuan.zhou&quot;&gt;siyuan.zhou&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tess.avitabile&quot; class=&quot;user-hover&quot; rel=&quot;tess.avitabile&quot;&gt;tess.avitabile&lt;/a&gt;, we realized that Simultaneous Index Builds on secondaries may cause problems for this solution. They make it impossible to take locks identically on the primary and on the secondary because there are unsynchronized lock acquisitions in the middle of the index build. If one of those lock acquisitions blocks on an &lt;tt&gt;afterClusterTime&lt;/tt&gt; read blocked on a prepared transaction, then a CRUD op on the same collection in oplog application could block behind that lock acquisition and prevent oplog application from making progress enough to commit the prepared transaction. CC &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=geert.bosch&quot; class=&quot;user-hover&quot; rel=&quot;geert.bosch&quot;&gt;geert.bosch&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="677165">SERVER-39169</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="741394">SERVER-40723</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="764261">SERVER-41090</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="674940">SERVER-39096</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="606934">SERVER-37199</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="652186">SERVER-38588</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="676205">SERVER-39139</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="681289">SERVER-39321</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>15.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</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>Mon, 4 Feb 2019 22:26:39 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 49 weeks, 5 days 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1032</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>
                            4 years, 49 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>9.0</customfieldvalue>

                        </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>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>geert.bosch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
            <customfieldvalue>xiangyu.yao@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hul7dj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hu9z93:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="2762">Storage NYC 2019-02-25</customfieldvalue>
    <customfieldvalue id="2763">Storage NYC 2019-03-11</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|huktmv:</customfieldvalue>

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