<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:12:43 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-46886] BackgroundSync (rollback) thread can hang on aborting the index build.</title>
                <link>https://jira.mongodb.org/browse/SERVER-46886</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Let&apos;s assume our indexBuild&apos;s coordinator thread pool size is 1 and a 3 node replica set. Say, node A, the primary, received 2 createIndexes cmd, one to build &apos;x&apos; and other to build &apos;y&apos; index on foo.bar collection.  Since the indexBuild&apos;s coordinator thread pool size is 1, we are able to start only the index build &apos;x&apos; on &apos;indexBuildsCoordinatorMongod&apos; thread pool. And, other index build &apos;y&apos; has to wait until the index build &apos;x&apos; completes and frees the thread.&lt;/p&gt;

&lt;p&gt;Also, assume the commit quorum value is &apos;all&apos;, so the index build &apos;x&apos; can&apos;t commit until it receives votes from other 2 secondaries (node B &amp;amp; node C). Assume, before replicating &apos;startIndexBuild&apos; oplog entry for index build &apos;x&apos; to secondaries, the primary stepped down and node C became new primary. And, node C doesn&apos;t know anything about index build &apos;x&apos; and &apos;y&apos; that were started on node A (old primary).  This would result in old primary (node A) to rollback. Before doing rollback, BackgroundSync thread aborts any &lt;a href=&quot;https://github.com/mongodb/mongo/blob/da473ca4c74db622bbd0cccf8bc93fcfa510d95f/src/mongo/db/index_builds_coordinator.cpp#L1039&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;active index builds&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Now, we can get into a deadlock scenario on node A, if&lt;br/&gt;
1) BackgroundSync thread signals the index build, say, &apos;y&apos; to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/da473ca4c74db622bbd0cccf8bc93fcfa510d95f/src/mongo/db/index_builds_coordinator.cpp#L953&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;abort&lt;/a&gt; and waits for the index builder (indexBuildsCoordinatorMongod-X) thread (for &apos;y&apos;) to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/da473ca4c74db622bbd0cccf8bc93fcfa510d95f/src/mongo/db/index_builds_coordinator.cpp#L817&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;join&lt;/a&gt;.&lt;br/&gt;
2) But, the index builder for &apos;y&apos; is stuck waiting for index build &apos;x&apos; to complete and free the indexBuildsCoordinatorMongod-X thread.&lt;br/&gt;
3) Index builder for &apos;x&apos; is waiting for &apos;BackgroundSync&apos; thread to signal abort its index build.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;The net effect is that the node A will get stuck on rollback process and couldn&apos;t transition to secondary replication state.&lt;/b&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1275406">SERVER-46886</key>
            <summary>BackgroundSync (rollback) thread can hang on aborting the index build.</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="13203">Gone away</resolution>
                                        <assignee username="milkie@mongodb.com">Eric Milkie</assignee>
                                    <reporter username="suganthi.mani@mongodb.com">Suganthi Mani</reporter>
                        <labels>
                    </labels>
                <created>Mon, 16 Mar 2020 13:41:45 +0000</created>
                <updated>Fri, 27 Oct 2023 20:42:18 +0000</updated>
                            <resolved>Tue, 7 Apr 2020 18:45:20 +0000</resolved>
                                                                    <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="3030022" author="milkie" created="Tue, 7 Apr 2020 18:45:21 +0000"  >&lt;p&gt;We made the thread pool unlimited in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47155&quot; title=&quot;Limit the number of simultaneous index builds running from user connections to 3&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47155&quot;&gt;&lt;del&gt;SERVER-47155&lt;/del&gt;&lt;/a&gt;, so that resolved this issue.&lt;/p&gt;</comment>
                            <comment id="2990008" author="milkie" created="Fri, 20 Mar 2020 18:25:08 +0000"  >&lt;p&gt;I agree, that&apos;s a reasonable solution for this one.&lt;/p&gt;</comment>
                            <comment id="2981162" author="suganthi.mani" created="Mon, 16 Mar 2020 14:14:50 +0000"  >&lt;p&gt;For each active index build, we currently abort the index build and wait for it join. This can lead to above deadlock scenario. So, the solution should be something, like this, we should abort all active index builds and then wait for all the index builder threads to join. &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="18953"><![CDATA[v4.4]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 20 Mar 2020 18:25:08 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 44 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>false</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>
                            3 years, 44 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_16465" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Linked BF Score</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>18.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>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|hx8pd3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hwwh93:</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="3633">Execution Team 2020-04-06</customfieldvalue>
    <customfieldvalue id="3634">Execution Team 2020-04-20</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|hx8bmf:</customfieldvalue>

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