<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:16:15 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-48137] Use DBLock instead of AutoGetDB in index builds</title>
                <link>https://jira.mongodb.org/browse/SERVER-48137</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;AutoGetDB &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4423364192774ed484dedd943a0bd1f04fd84e41/src/mongo/db/catalog_raii.cpp#L54&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;can throw&lt;/a&gt; with a StaleDBVersion error. &lt;/p&gt;

&lt;p&gt;Index builds rely on waiting until &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4423364192774ed484dedd943a0bd1f04fd84e41/src/mongo/db/index_builds_coordinator.cpp#L2210-L2250&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;critical section&lt;/a&gt; to let exceptions throw. Anything thrown before that will cause the server to crash.&lt;/p&gt;

&lt;p&gt;Use a DBLock then manually check the dbVersion under this exception handler.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1348052">SERVER-48137</key>
            <summary>Use DBLock instead of AutoGetDB in index builds</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="louis.williams@mongodb.com">Louis Williams</assignee>
                                    <reporter username="louis.williams@mongodb.com">Louis Williams</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 May 2020 14:20:30 +0000</created>
                <updated>Sun, 29 Oct 2023 22:08:21 +0000</updated>
                            <resolved>Thu, 14 May 2020 15:50:47 +0000</resolved>
                                                    <fixVersion>4.4.0-rc7</fixVersion>
                    <fixVersion>4.7.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3090766" author="xgen-internal-githook" created="Fri, 15 May 2020 21:21:56 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48137&quot; title=&quot;Use DBLock instead of AutoGetDB in index builds&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48137&quot;&gt;&lt;del&gt;SERVER-48137&lt;/del&gt;&lt;/a&gt; Use DBLock instead of AutoGetDB in index builds&lt;/p&gt;

&lt;p&gt;Index builds do not handle exceptions until a final critical section. AutoGetDB can throw&lt;br/&gt;
due to stale database or shard versions, which is checked explicitly when an index build completes.&lt;/p&gt;

&lt;p&gt;(cherry picked from commit 5dc21b311ba95877eae491f2f3422402bddd8ee0)&lt;br/&gt;
Branch: v4.4&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/cec3439a2d03fc94a4eec2903c76fe44e4c5b69d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/cec3439a2d03fc94a4eec2903c76fe44e4c5b69d&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3086191" author="xgen-internal-githook" created="Thu, 14 May 2020 15:47:38 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Louis Williams&apos;, &apos;email&apos;: &apos;louis.williams@mongodb.com&apos;, &apos;username&apos;: &apos;louiswilliams&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48137&quot; title=&quot;Use DBLock instead of AutoGetDB in index builds&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48137&quot;&gt;&lt;del&gt;SERVER-48137&lt;/del&gt;&lt;/a&gt; Use DBLock instead of AutoGetDB in index builds&lt;/p&gt;

&lt;p&gt;Index builds do not handle exceptions until a final critical section. AutoGetDB can throw&lt;br/&gt;
due to stale database or shard versions, which is checked explicitly when an index build completes.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/5dc21b311ba95877eae491f2f3422402bddd8ee0&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/5dc21b311ba95877eae491f2f3422402bddd8ee0&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3083288" author="louis.williams" created="Wed, 13 May 2020 14:58:40 +0000"  >&lt;p&gt;Great, that makes sense. I&apos;ll switch to using DBLock to bypass the dbversion checks until the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4423364192774ed484dedd943a0bd1f04fd84e41/src/mongo/db/index_builds_coordinator.cpp#L2217&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;explicit call&lt;/a&gt; when we can handle exceptions.&lt;/p&gt;</comment>
                            <comment id="3083165" author="kaloian.manassiev" created="Wed, 13 May 2020 14:22:36 +0000"  >&lt;p&gt;Ah, this actually makes more sense now. The reason why we check for DB/Shard version changes as part of the index build is to discover changes to the index composition and abort the index build and force it to start over (at least that&apos;s how I understand it - &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jack.mulrow&quot; class=&quot;user-hover&quot; rel=&quot;jack.mulrow&quot;&gt;jack.mulrow&lt;/a&gt;?). So both the setting of the DB/Shard version must stay in some form. I am not familiar with the concurrency rules around the index build critical section, but lock cannot be dropped and re-taken after &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4423364192774ed484dedd943a0bd1f04fd84e41/src/mongo/db/index_builds_coordinator.cpp#L2217&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this&lt;/a&gt; check, then it should be fine to not use AutoGetDb if it causes exception to be thrown at an inopportune time.&lt;/p&gt;

&lt;p&gt;A cleaner solution would be to just handle the exception.&lt;/p&gt;</comment>
                            <comment id="3083135" author="louis.williams" created="Wed, 13 May 2020 14:13:36 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kaloian.manassiev&quot; class=&quot;user-hover&quot; rel=&quot;kaloian.manassiev&quot;&gt;kaloian.manassiev&lt;/a&gt;, it looks like &lt;a href=&quot;https://github.com/mongodb/mongo/commit/eba76c558b3e7d784c146b51ced16d48b1d0efe7#diff-2de8e1ae5b2aa69d9cf25a2f70dfba38R146-R200&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;we copy the dbVersion and shardVersion&lt;/a&gt; from the client OperationContext to the index builder thread&apos;s operation context. This was added as part of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44719&quot; title=&quot;Make createIndexes, dropIndexes, and collMod check shard versions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44719&quot;&gt;&lt;del&gt;SERVER-44719&lt;/del&gt;&lt;/a&gt;. But that was done before &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46122&quot; title=&quot;Make the drop command abort in-progress index builds&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46122&quot;&gt;&lt;del&gt;SERVER-46122&lt;/del&gt;&lt;/a&gt; which allowed the &apos;drop&apos; command to abort in-progress index builds. Do you think the dbversion initialization is not necessary anymore?&lt;/p&gt;</comment>
                            <comment id="3082656" author="kaloian.manassiev" created="Wed, 13 May 2020 08:44:38 +0000"  >&lt;p&gt;I don&apos;t know why this check is there and more importantly why does it have a DBVersion on the OperationContext at all if it is an internal thread. There must be something higher-up in that code path, which is setting it, or it is not always an internal thread?&lt;/p&gt;

&lt;p&gt;The database version can change as a result of &lt;tt&gt;movePrimary&lt;/tt&gt; or &lt;tt&gt;dropDatabase&lt;/tt&gt;, which should technically interrupt the index build, but this should happen through the act of dropping the collection, not by doing version checking internally. &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=jack.mulrow&quot; class=&quot;user-hover&quot; rel=&quot;jack.mulrow&quot;&gt;jack.mulrow&lt;/a&gt;, is this something new perhaps due to the &quot;Consistent Indexes&quot; project?&lt;/p&gt;</comment>
                            <comment id="3081178" author="louis.williams" created="Tue, 12 May 2020 16:25:34 +0000"  >&lt;p&gt;This is happening on an internal thread that is started on behalf of a user &quot;createIndex&quot; operation. There is a manual check for the dbVersion &lt;a href=&quot;https://github.com/mongodb/mongo/blob/e2602ad053b2120982fbcac8e33e1ad64e6ec30a/src/mongo/db/index_builds_coordinator.cpp#L2217&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;in the critical section&lt;/a&gt; that has been there for a very long time, so I assume it&apos;s still required? &lt;/p&gt;</comment>
                            <comment id="3081085" author="kaloian.manassiev" created="Tue, 12 May 2020 15:55:56 +0000"  >&lt;p&gt;Is this error thrown from an internal index build thread or it happens on the user thread? Because internal threads are not supposed to have a DbVersion on the OpContext, so they should never throw this exception. This might be similar to the issue in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-48128&quot; title=&quot;mapreduce and aggregation with output don&amp;#39;t work on rs to cluster upgrade&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-48128&quot;&gt;&lt;del&gt;SERVER-48128&lt;/del&gt;&lt;/a&gt;.&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>8.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_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_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>Tue, 12 May 2020 15:55:56 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 38 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_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_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>
                            3 years, 38 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>30.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>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxkunj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hx2pmn:</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="3876">Execution Team 2020-05-18</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|hxkgwv:</customfieldvalue>

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