<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:04:48 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-44036] Ensure that we check for existing indexes under a MODE_IX collection lock during createIndexes before taking the MODE_X collection lock</title>
                <link>https://jira.mongodb.org/browse/SERVER-44036</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Neither the successful and unsuccessful (&lt;tt&gt;IndexKeySpecsConflict&lt;/tt&gt;) cases modify the catalog, so just use &lt;tt&gt;MODE_IX&lt;/tt&gt; collection locks in all cases where an index already exists before we take the MODE_X lock.&lt;/p&gt;</description>
                <environment></environment>
        <key id="970679">SERVER-44036</key>
            <summary>Ensure that we check for existing indexes under a MODE_IX collection lock during createIndexes before taking the MODE_X collection lock</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="maria.vankeulen@mongodb.com">Maria van Keulen</assignee>
                                    <reporter username="geert.bosch@mongodb.com">Geert Bosch</reporter>
                        <labels>
                    </labels>
                <created>Tue, 15 Oct 2019 21:10:57 +0000</created>
                <updated>Sun, 29 Oct 2023 22:16:04 +0000</updated>
                            <resolved>Wed, 6 Nov 2019 15:02:45 +0000</resolved>
                                                    <fixVersion>4.3.1</fixVersion>
                                    <component>Catalog</component>
                    <component>Index Maintenance</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="2519019" author="xgen-internal-githook" created="Tue, 5 Nov 2019 22:02:01 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Maria van Keulen&apos;, &apos;username&apos;: &apos;mvankeulen94&apos;, &apos;email&apos;: &apos;maria.vankeulen@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-44036&quot; title=&quot;Ensure that we check for existing indexes under a MODE_IX collection lock during createIndexes before taking the MODE_X collection lock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-44036&quot;&gt;&lt;del&gt;SERVER-44036&lt;/del&gt;&lt;/a&gt; Test that existing index creation takes intent locks&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/da5cd52964f1e5551360ed21e84bcf8ab129ba47&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/da5cd52964f1e5551360ed21e84bcf8ab129ba47&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2514112" author="maria.vankeulen" created="Fri, 1 Nov 2019 15:05:02 +0000"  >&lt;p&gt;We accept the case where createIndexes inside a transaction hangs on an in-progress index build outside of a transaction. We do not care about the reverse case since we only allow createIndexes inside of a transaction if the index already exists or on a collection that was created inside the same transaction.&lt;br/&gt;
The remaining work for this ticket is to add a test that createIndexes on an index that already exists as of the beginning of the createIndexes command only needs an IX lock.&lt;/p&gt;</comment>
                            <comment id="2513868" author="maria.vankeulen" created="Fri, 1 Nov 2019 13:11:55 +0000"  >&lt;p&gt;As an update, the function &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0cbee170444cd668fb972196047464ec6b904bbd/src/mongo/db/catalog/index_catalog_impl.cpp#L329&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;IndexCatalogImpl::prepareSpecForCreate&lt;/tt&gt;&lt;/a&gt;, which is called before we take the MODE_X collection lock during createIndexes, does handle all success/error cases of an index already existing with conflicting specs.&lt;br/&gt;
However, as of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40926&quot; title=&quot;createIndexes should return IndexBuildAlreadyInProgress errors&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40926&quot;&gt;&lt;del&gt;SERVER-40926&lt;/del&gt;&lt;/a&gt;/&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40927&quot; title=&quot;createIndexes should wait for indexes found to already be being built to finish&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40927&quot;&gt;&lt;del&gt;SERVER-40927&lt;/del&gt;&lt;/a&gt;, createIndexes on an index that is already in progress will &lt;a href=&quot;https://github.com/mongodb/mongo/blob/0cbee170444cd668fb972196047464ec6b904bbd/src/mongo/db/commands/create_indexes.cpp#L864-L886&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;hang&lt;/a&gt; until the in-progress build finishes.&lt;br/&gt;
This might be adverse behavior for transactions. &lt;/p&gt;</comment>
                            <comment id="2509138" author="maria.vankeulen" created="Wed, 30 Oct 2019 20:28:21 +0000"  >&lt;p&gt;I have confirmed 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; that for this ticket we do not care about the cases where we encounter index build conflicts after taking the exclusive collection lock.&lt;/p&gt;

&lt;p&gt;Since we have an existing framework for checking for existing indexes before taking this lock (see my above comment) the work for this ticket should be to verify that this framework handles all possible existing index scenarios.&lt;/p&gt;</comment>
                            <comment id="2508921" author="maria.vankeulen" created="Wed, 30 Oct 2019 18:44:06 +0000"  >&lt;p&gt;We presently &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a5af8f0d44f1cfef576241213039ee4730b7ed57/src/mongo/db/commands/create_indexes.cpp#L684-L686&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;check for existing indexes&lt;/a&gt; under a Collection IX lock before taking the exclusive collection lock during index builds.&lt;/p&gt;

&lt;p&gt;Two other cases of interest are the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a6c0031a6568483a5fa375607cc99af3ead87991/src/mongo/db/index_builds_coordinator.cpp#L820&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;success case&lt;/a&gt; and the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/a5af8f0d44f1cfef576241213039ee4730b7ed57/src/mongo/db/catalog/multi_index_block.cpp#L295&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;failure case&lt;/a&gt; that occur after we have the Collection X lock.&lt;/p&gt;

&lt;p&gt;IIUC, we cannot guarantee that we avoid conflicts with existing builds until after we hold the Collection X lock. As a result, I don&apos;t think we can refactor the aforementioned success/failure cases to occur exclusively outside of the Collection X lock. We can determine if it&apos;s possible to release the Collection X lock earlier once we have encountered the index conflicts.&lt;/p&gt;</comment>
                    </comments>
                    <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_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>Wed, 30 Oct 2019 18:44:06 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 14 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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1168</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, 14 weeks, 1 day ago
                        </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>geert.bosch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>maria.vankeulen@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hvxod3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr647z:</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="3345">Execution Team 2019-11-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|hvxamf:</customfieldvalue>

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