<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:35:16 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-34008] ensure LockManager complexity is not O(n**2) for n taken locks</title>
                <link>https://jira.mongodb.org/browse/SERVER-34008</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently we do linear scans to look up locks, which leads to quadratic complexity for taking many locks.  C++17 introduces map features that will allow us to replace our custom FastMapNoAlloc with a standard container while maintaining the reduced allocation benefits reaped from the custom container.&lt;/p&gt;
</description>
                <environment></environment>
        <key id="514055">SERVER-34008</key>
            <summary>ensure LockManager complexity is not O(n**2) for n taken locks</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="daniel.gottlieb@mongodb.com">Daniel Gottlieb</assignee>
                                    <reporter username="dianna.hohensee@mongodb.com">Dianna Hohensee</reporter>
                        <labels>
                            <label>execution_intern</label>
                            <label>neweng</label>
                    </labels>
                <created>Tue, 20 Mar 2018 18:28:13 +0000</created>
                <updated>Wed, 2 Oct 2019 17:49:33 +0000</updated>
                            <resolved>Wed, 2 Oct 2019 17:49:33 +0000</resolved>
                                                                    <component>Concurrency</component>
                    <component>Storage</component>
                                        <votes>0</votes>
                                    <watches>6</watches>
                                                                                                                <comments>
                            <comment id="2447808" author="daniel.gottlieb@10gen.com" created="Wed, 2 Oct 2019 17:49:33 +0000"  >&lt;p&gt;Doing some basic profiling on my machine shows that a transaction operating on 10,000 collections will spend ~1 second walking locks. &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; and I consider that inconsequential. The main motivation for adding an optimization here would be if the walk time was 10x+ more expensive.&lt;/p&gt;</comment>
                            <comment id="2407565" author="geert.bosch" created="Wed, 4 Sep 2019 18:00:31 +0000"  >&lt;p&gt;Ah, now I see what you&apos;re asking for. The problem with the existing map was that it&apos;s too slow because it would cause amalloc/free for every lock acquisition. However, with C++17, we now have &lt;tt&gt;extract&lt;/tt&gt; and &lt;tt&gt;merge&lt;/tt&gt;, which would allow moving freed nodes to a freelist (map) with a zeroed out key.&lt;/p&gt;

&lt;p&gt;It would be good to verify that the behavior can actually show up today, so the first step would probably be to try some transaction that accesses 10,000 collections or so, and see how things break down or not. The goal would be to not lose too much perf in the normal case of few locks while avoiding terrible perf in the weird case.&lt;/p&gt;</comment>
                            <comment id="2406399" author="daniel.gottlieb@10gen.com" created="Wed, 4 Sep 2019 01:04:21 +0000"  >&lt;p&gt;Yes that&apos;s why the current implementation can be considered quadratic. I&apos;m unsure what was introduced in C++17 that lets us use a different data structure (&lt;tt&gt;std::map&lt;/tt&gt;?) to verify that it would be a correct substitute.&lt;/p&gt;</comment>
                            <comment id="2406089" author="geert.bosch" created="Tue, 3 Sep 2019 20:35:23 +0000"  >&lt;p&gt;Because the map is implemented as a &lt;tt&gt;std::deque&lt;/tt&gt;, any insert of a key &lt;a href=&quot;https://github.com/mongodb/mongo/blob/ff685d2d6e370594261eccbef8e60b2f7cc61e28/src/mongo/db/concurrency/fast_map_noalloc.h#L216-L219&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;walks all entries&lt;/a&gt; to find it.&lt;/p&gt;</comment>
                            <comment id="2402267" author="daniel.gottlieb@10gen.com" created="Fri, 30 Aug 2019 18:02:31 +0000"  >&lt;p&gt;&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;, I believe you wrote the current version of this description. Do you happen to know the name of the map feature?&lt;/p&gt;</comment>
                            <comment id="2075336" author="milkie" created="Thu, 29 Nov 2018 14:21:49 +0000"  >&lt;p&gt;Putting in 4.3 Required to re-examine the work for this after C++17 is available for use.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="497591">SERVER-33316</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 29 Nov 2018 14:21:49 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 19 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>daniel.gottlieb@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 19 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>daniel.gottlieb@mongodb.com</customfieldvalue>
            <customfieldvalue>dianna.hohensee@mongodb.com</customfieldvalue>
            <customfieldvalue>milkie@mongodb.com</customfieldvalue>
            <customfieldvalue>geert.bosch@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|htt4g7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hvbn6f:</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="3034">Execution Team 2019-07-01</customfieldvalue>
    <customfieldvalue id="3210">Execution Team 2019-09-09</customfieldvalue>
    <customfieldvalue id="3211">Execution Team 2019-09-23</customfieldvalue>
    <customfieldvalue id="3212">Execution Team 2019-10-07</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|htsqnj:</customfieldvalue>

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