<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:52:53 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-39708] Fastpath no-ops to multikey updates in IndexBuildInterceptor::sideWrite to avoid mutex acquisition</title>
                <link>https://jira.mongodb.org/browse/SERVER-39708</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The hybrid index build&apos;s &lt;tt&gt;IndexBuildInterceptor&lt;/tt&gt; accumulates multikey changes in memory which is used to update the persisted index metadata once at the end of the index build.&lt;/p&gt;

&lt;p&gt;Every document inserted into the &quot;side table&quot; will &lt;a href=&quot;https://github.com/mongodb/mongo/blob/798812c292833b513919a468f2bb351cb1ffb47d/src/mongo/db/index/index_build_interceptor.cpp#L389-L396&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;grab a mutex to update this in-memory multikey paths variable&lt;/a&gt;. In the common case where a document is not multikey, this shared state does not need to be modified (multikey is similar to a set that can only be added to).&lt;/p&gt;

&lt;p&gt;The serialization was done out of convenience. There&apos;s only one exposed helper method for working with &lt;a href=&quot;https://github.com/mongodb/mongo/blob/798812c292833b513919a468f2bb351cb1ffb47d/src/mongo/db/index/multikey_paths.h#L57&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;MultikeyPaths&lt;/tt&gt; &quot;objects&quot;&lt;/a&gt;. Specifically, the following two methods would allow only grabbing the mutex when a document is multikey w.r.t. an index:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Instantiating the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/798812c292833b513919a468f2bb351cb1ffb47d/src/mongo/db/index/multikey_paths.h#L53&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;default/&quot;empty&quot;&lt;/a&gt; multikey object for a given index spec.&lt;/li&gt;
	&lt;li&gt;A predicate that says whether a &lt;tt&gt;MultikeyPaths&lt;/tt&gt; is equal to the default/&quot;empty&quot;.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Given (1), the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/798812c292833b513919a468f2bb351cb1ffb47d/src/mongo/db/index/index_build_interceptor.h#L151&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;&lt;tt&gt;_multikeyPaths&lt;/tt&gt;&lt;/a&gt; can be initialized to the correct &quot;shape&quot; at &lt;tt&gt;IndexBuildInterceptor&lt;/tt&gt; construction time. &lt;a href=&quot;https://github.com/mongodb/mongo/blob/798812c292833b513919a468f2bb351cb1ffb47d/src/mongo/db/index/index_build_interceptor.cpp#L392-L396&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;This clause can be removed&lt;/a&gt;.&lt;br/&gt;
Given (2) &lt;a href=&quot;https://github.com/mongodb/mongo/blob/798812c292833b513919a468f2bb351cb1ffb47d/src/mongo/db/index/index_build_interceptor.cpp#L391&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;merging&lt;/a&gt; would only need to happen if the document could potentially change multikey state.&lt;/p&gt;

&lt;p&gt;UPDATE: This optimization was only made for BTree indexes because all other index types either do not track path-level multikey information or have &quot;special&quot; handling of multikey paths.&lt;/p&gt;</description>
                <environment></environment>
        <key id="701774">SERVER-39708</key>
            <summary>Fastpath no-ops to multikey updates in IndexBuildInterceptor::sideWrite to avoid mutex acquisition</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="13201">Fixed</resolution>
                                        <assignee username="maria.vankeulen@mongodb.com">Maria van Keulen</assignee>
                                    <reporter username="daniel.gottlieb@mongodb.com">Daniel Gottlieb</reporter>
                        <labels>
                    </labels>
                <created>Thu, 21 Feb 2019 04:00:00 +0000</created>
                <updated>Sun, 29 Oct 2023 22:23:47 +0000</updated>
                            <resolved>Wed, 11 Sep 2019 14:03:45 +0000</resolved>
                                                    <fixVersion>4.2.1</fixVersion>
                    <fixVersion>4.3.1</fixVersion>
                                    <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="2420153" author="xgen-internal-githook" created="Fri, 13 Sep 2019 20:17:33 +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-39708&quot; title=&quot;Fastpath no-ops to multikey updates in IndexBuildInterceptor::sideWrite to avoid mutex acquisition&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39708&quot;&gt;&lt;del&gt;SERVER-39708&lt;/del&gt;&lt;/a&gt; Optimize Btree multikey updates&lt;/p&gt;

&lt;p&gt;(cherry picked from commit bfac8d909877600c395dccc575effbfbae76a82a)&lt;br/&gt;
Branch: v4.2&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/ade1c1f91effa7b86aa8b82daa8548d360b2bc68&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/ade1c1f91effa7b86aa8b82daa8548d360b2bc68&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2415380" author="xgen-internal-githook" created="Tue, 10 Sep 2019 21:59:42 +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-39708&quot; title=&quot;Fastpath no-ops to multikey updates in IndexBuildInterceptor::sideWrite to avoid mutex acquisition&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-39708&quot;&gt;&lt;del&gt;SERVER-39708&lt;/del&gt;&lt;/a&gt; Optimize Btree multikey updates&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/bfac8d909877600c395dccc575effbfbae76a82a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/bfac8d909877600c395dccc575effbfbae76a82a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="2352694" author="milkie" created="Wed, 31 Jul 2019 17:06:43 +0000"  >&lt;p&gt;I put this ticket on hold and moved it for consideration again in the next QW bucket.&lt;/p&gt;</comment>
                            <comment id="2352605" author="maria.vankeulen" created="Wed, 31 Jul 2019 16:08:46 +0000"  >&lt;p&gt;I ran into another hiccup when excluding text and wildcard indexes from these checks. &lt;a href=&quot;https://github.com/mongodb/mongo/blob/587b784040cf64f4e62bcf07bc38b60def249759/src/mongo/dbtests/wildcard_multikey_persistence_test.cpp#L717-L755&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;These tests&lt;/a&gt; fail as of my changes, because they rely on multikeyPaths being equal to boost::none to indicate that the index should &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9d699f8d3bd0b4aac51eb6a8d731275afb31c4a9/src/mongo/db/catalog/multi_index_block.cpp#L747&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;not be marked as multikey&lt;/a&gt;. We cannot make assumptions regarding whether wildcard indexes are multikey, so we cannot rely on checking the type of the index to substitute checking equality against boost::none in the code. Some further consideration is necessary for this work, so I believe this ticket should be revisited at a later time. CC &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;/p&gt;</comment>
                            <comment id="2351051" author="maria.vankeulen" created="Tue, 30 Jul 2019 19:02:51 +0000"  >&lt;p&gt;There are some wrinkles with this work because of wildcard and text indexes. Presently in the code, both of these indexes can end up with empty MultikeyPaths passed to &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9d699f8d3bd0b4aac51eb6a8d731275afb31c4a9/src/mongo/db/catalog/index_catalog_impl.cpp#L1248&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;sideWrite&lt;/a&gt;, but still be &lt;a href=&quot;https://github.com/mongodb/mongo/blob/9d699f8d3bd0b4aac51eb6a8d731275afb31c4a9/src/mongo/db/catalog/index_catalog_entry_impl.cpp#L276&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;marked as multiKey&#160;&lt;/a&gt;. It seems like marking text indexes as multikey is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/7b89e5c5e6102f086a50e6e4a8ee22ce7160d559/src/mongo/db/query/plan_enumerator.cpp#L661-L662&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;unexpected behavior&lt;/a&gt;. It seems like wildcard indexes have their &lt;a href=&quot;https://github.com/mongodb/mongo/blob/7b89e5c5e6102f086a50e6e4a8ee22ce7160d559/src/mongo/db/index/wildcard_access_method.h#L84&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;own&lt;/a&gt; means of tracking multikey paths, which is separate from the code paths that update &lt;tt&gt;_multikeyPaths&lt;/tt&gt;.&lt;br/&gt;
I will investigate whether there is a straightforward way to exclude these two index types from this work, and if so, file a ticket for follow-up work to address these two indexes.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10420">
                    <name>Backports</name>
                                            <outwardlinks description="backported by">
                                                        </outwardlinks>
                                                        </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>3.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_12450" key="com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes">
                        <customfieldname>Backport Requested</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16775"><![CDATA[v4.2]]></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, 30 Jul 2019 19:02:51 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 21 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1494</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, 21 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>daniel.gottlieb@mongodb.com</customfieldvalue>
            <customfieldvalue>milkie@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|huo8pz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hvauy7:</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="3090">Execution Team 2019-07-29</customfieldvalue>
    <customfieldvalue id="3210">Execution Team 2019-09-09</customfieldvalue>
    <customfieldvalue id="3211">Execution Team 2019-09-23</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|hunuzb:</customfieldvalue>

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