<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:04: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-44045] allow secondary index builds to start without unlocking the RSTL</title>
                <link>https://jira.mongodb.org/browse/SERVER-44045</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;One of the planned improvements related to two phase index builds require secondary nodes in a replica set to be able to continue to run index builds  on stepping up to primary. This requires the new primary node to hold the RSTL in order to write the &lt;tt&gt;commitIndexBuild&lt;/tt&gt; or &lt;tt&gt;abortIndexBuild&lt;/tt&gt; entries to the oplog.&lt;/p&gt;

&lt;p&gt;Index builds on secondary nodes current &lt;a href=&quot;https://github.com/mongodb/mongo/blob/08d2e61fd16a1e80c35e69176fed61717e1fea1e/src/mongo/db/index_builds_coordinator.cpp#L857-L864&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;unlock the RSTL&lt;/a&gt; before starting (specifically, the scanning, draining, and completion phases). This logic was introduced in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-41462&quot; title=&quot;do not lock RSTL for uninterruptible index lock operations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-41462&quot;&gt;&lt;del&gt;SERVER-41462&lt;/del&gt;&lt;/a&gt; to avoid deadlocks with prepared transactions on replica set transitions such as step up/down.&lt;/p&gt;

&lt;p&gt;In &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-42824&quot; title=&quot;do not lock RSTL for index build cleanup&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-42824&quot;&gt;&lt;del&gt;SERVER-42824&lt;/del&gt;&lt;/a&gt;, we started unlocking the RSTL on both primary and secondary nodes before cleaning up a failed index build. This logic was recently moved into the &lt;tt&gt;IndexBuildsCoordinator&lt;/tt&gt; in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-43415&quot; title=&quot;indexbg_killop_primary.js crashes when two phase index builds are enabled&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-43415&quot;&gt;&lt;del&gt;SERVER-43415&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To support two phase index builds, it would be desirable to remove the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/08d2e61fd16a1e80c35e69176fed61717e1fea1e/src/mongo/db/index_builds_coordinator.cpp#L857-L864&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;RSTL unlocking logic&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="971168">SERVER-44045</key>
            <summary>allow secondary index builds to start without unlocking the RSTL</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="louis.williams@mongodb.com">Louis Williams</assignee>
                                    <reporter username="benety.goh@mongodb.com">Benety Goh</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Oct 2019 15:41:46 +0000</created>
                <updated>Fri, 17 Apr 2020 19:41:14 +0000</updated>
                            <resolved>Fri, 17 Apr 2020 19:37:16 +0000</resolved>
                                                                    <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3045415" author="louis.williams" created="Fri, 17 Apr 2020 19:37:17 +0000"  >&lt;p&gt;This is fixed by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46989&quot; title=&quot;Index builds should hold RSTL to prevent replication state changes after deciding to commit or abort&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46989&quot;&gt;&lt;del&gt;SERVER-46989&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2538152" author="suganthi.mani" created="Wed, 13 Nov 2019 00:51:27 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=benety.goh&quot; class=&quot;user-hover&quot; rel=&quot;benety.goh&quot;&gt;benety.goh&lt;/a&gt;, &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-41462&quot; title=&quot;do not lock RSTL for uninterruptible index lock operations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-41462&quot;&gt;&lt;del&gt;SERVER-41462&lt;/del&gt;&lt;/a&gt;&#160;is to fix a 3 way deadlock if the sequence is something like below.&lt;/p&gt;

&lt;p&gt;1) Hybrid index build gets started on secondary for a collection A. And, collection phase of hybrid index build on secondary gets yielded. (Makes all the mongoDB and document level locks to get released - abandons the snapshot).&lt;br/&gt;
 2) Secondary node steps up and becomes the new primary.&lt;br/&gt;
 3) Transaction gets stated and inserts some documents in collection A. (This step acquires the collection lock in mode IX)&lt;br/&gt;
 4) Transaction gets prepared. (After which, it holds the mongoDB locks (database, collection, global) except RSTL lock).&lt;br/&gt;
 5) Index build started at step #1, gets resumed and moves to drain phase which tries to acquires collection lock in S mode. But, then, it gets blocked on prepared transaction due to collection lock conflict.&lt;br/&gt;
 5) Now, the node tries to steps down. So, it enqueues the RSTL lock in X mode and blocks behind the index builder (as it holds RSTL lock).&lt;br/&gt;
 6) Transaction cannot be committed as it blocked behind step down waiting for RSTL lock.&lt;/p&gt;

&lt;p&gt;And, the repro script will be the same as the one attached in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44507&quot; title=&quot;Hybrid index build is able to commit (acquire stronger mode locks) for a collection that contains prepared documents. (4.2 only)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44507&quot;&gt;&lt;del&gt;SERVER-44507&lt;/del&gt;&lt;/a&gt;. &lt;br/&gt;
Note: This 3 way dead lock problem applies even for &lt;a href=&quot;https://github.com/mongodb/mongo/blob/05f45f9a3f3deb4e5d1e3e1f2ab1e4a2b80e959e/src/mongo/db/index_builds_coordinator.cpp#L1105&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;2-phase index build&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2489883" author="benety.goh" created="Fri, 18 Oct 2019 15:05:56 +0000"  >&lt;p&gt;Was there a reproduction script provided for &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-41462&quot; title=&quot;do not lock RSTL for uninterruptible index lock operations&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-41462&quot;&gt;&lt;del&gt;SERVER-41462&lt;/del&gt;&lt;/a&gt;? It would help us understand better the underlying issues and have a more productive discussion on alternative solutions.&lt;/p&gt;</comment>
                            <comment id="2485424" author="judah.schvimer" created="Wed, 16 Oct 2019 18:31:18 +0000"  >&lt;p&gt;What&apos;s the alternative to unlocking the RSTL? I think if we remove the collection S/X locks that index builds acquire then we could. I don&apos;t remember us having any alternative to unlocking the RSTL when we added that code.&lt;/p&gt;</comment>
                            <comment id="2484949" author="benety.goh" created="Wed, 16 Oct 2019 15:48:56 +0000"  >&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;, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=suganthi.mani&quot; class=&quot;user-hover&quot; rel=&quot;suganthi.mani&quot;&gt;suganthi.mani&lt;/a&gt;, any thoughts?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="1282330">SERVER-46989</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="994275">SERVER-44507</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="759571">SERVER-41033</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="935320">SERVER-43415</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1252397">SERVER-46704</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="685965">SERVER-39451</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="685966">SERVER-39452</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="787591">SERVER-41462</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="895861">SERVER-42824</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="959721">SERVER-43837</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>5.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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 16 Oct 2019 18:31:18 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 42 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_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>louis.williams@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 42 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>0.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>benety.goh@mongodb.com</customfieldvalue>
            <customfieldvalue>judah.schvimer@mongodb.com</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
            <customfieldvalue>suganthi.mani@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hvxrbr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hx3bmf:</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="3344">Execution Team 2019-11-04</customfieldvalue>
    <customfieldvalue id="3635">Execution Team 2020-05-04</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|hvxdl3:</customfieldvalue>

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