<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:14:44 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-69893] Add the ability to acquire lock manager mutex resources by name</title>
                <link>https://jira.mongodb.org/browse/SERVER-69893</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In Sharding we have a requirement to be able to lock some object by name (where an object is database or collection) for short period of time, while we perform some in-memory modifications on that object.&lt;/p&gt;

&lt;p&gt;These are much lighterweight locks than our current DB/Collection locks in that we will never do blocking operations under than and also they do not require 2-phase locking.&lt;/p&gt;

&lt;p&gt;The current RESOURCE_MUTEX is unsafe to be acquired with a manually constructed string that contains the DB or Collection name in it, because the hash to string resolution relies on the hash mapping to a string name.&lt;/p&gt;

&lt;p&gt;I am realising now that this is not correct, because RESOURCE_MUTEX&apos;s implementation (and its logging specifically) assumes that the ResourceMutex class is in control of generating the ResourceIds, rather than just taking the hash of the string that&apos;s passed as the resource name. Thus, right now these usages violate the implicit contract of RESOURCE_MUTEX.&lt;/p&gt;

&lt;p&gt;Given the requirements above, we still need to be able to lock something by name and we don&apos;t care about hash collisions.&lt;/p&gt;

&lt;p&gt;For this purpose I would like to extend the lock manager with the following resource types with more stricter semantics:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;TopResourceMutex: Not allowed to be locked by random string and the lock manager controls what hashes get assigned to each one; the only way to use it through a TopLevelResourceMutex class; can only be the first lock acquired; The use case is to disallow for example two instances of the same command to run concurrently;&lt;/li&gt;
	&lt;li&gt;ResourceMutex: Same as the current resource mutex; cannot do blocking operations while holding it;&lt;/li&gt;
	&lt;li&gt;NamedLock: Allowed to be locked by random string; Not interruptible and no Global/DB/Collection locks can be taken after it (i.e., it must be at the bottom of the hierarchy)&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="2143073">SERVER-69893</key>
            <summary>Add the ability to acquire lock manager mutex resources by name</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="kaloian.manassiev@mongodb.com">Kaloian Manassiev</assignee>
                                    <reporter username="kaloian.manassiev@mongodb.com">Kaloian Manassiev</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Sep 2022 10:54:37 +0000</created>
                <updated>Tue, 14 Nov 2023 10:46:52 +0000</updated>
                            <resolved>Tue, 14 Nov 2023 10:45:34 +0000</resolved>
                                                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="5878087" author="kaloian.manassiev" created="Tue, 14 Nov 2023 10:45:34 +0000"  >&lt;p&gt;In the end we haven&apos;t had a pressing need for this change and it would be a net improvement if we just started using the database/collection locks in smaller scopes (i.e., not for the duration of an entire DDL or CRUD operation, but just for committing).&lt;/p&gt;

&lt;p&gt;Closing as Won&apos;t Fix.&lt;/p&gt;</comment>
                            <comment id="5516195" author="kaloian.manassiev" created="Wed, 21 Jun 2023 18:15:33 +0000"  >&lt;p&gt;I would like to reopen the discussion around this proposal here where had we at least done the part with two-level resource mutexes we would have caught deadlocks like the one in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-78229&quot; title=&quot;createIndexes should acquire the CollectionLock of the targeted nss before accessing the parent DatabaseShardingState&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-78229&quot;&gt;&lt;del&gt;SERVER-78229&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We don&apos;t necessarily need to do the &lt;tt&gt;boost::optional&lt;/tt&gt; improvements that are in the PR, but at least the two-level mutexes.&lt;/p&gt;</comment>
                            <comment id="4922316" author="JIRAUSER1257318" created="Mon, 24 Oct 2022 14:49:16 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-70610&quot; title=&quot;Move the DatabaseShardingState RESOURCE_MUTEXes to the DatabaseShardingStateMap&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-70610&quot;&gt;&lt;del&gt;SERVER-70610&lt;/del&gt;&lt;/a&gt; took a different approach where we use a &quot;normal&quot; RESOURCE_MUTEX for each database, so we don&apos;t need named resourceMutexes now.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="2129139">SERVER-69435</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="2154084">SERVER-70322</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2156092">SERVER-70431</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2372404">SERVER-78229</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2151121">SERVER-70198</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="2156696">SERVER-70467</issuekey>
        </issuelink>
                            </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>4.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 23 Sep 2022 10:51:31 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 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>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>jordi.serra-torrens@mongodb.com</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i1bbwn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i0uuq6:6</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="6550">Sharding EMEA 2022-10-03</customfieldvalue>
    <customfieldvalue id="6551">Sharding EMEA 2022-10-17</customfieldvalue>
    <customfieldvalue id="6552">Sharding EMEA 2022-10-31</customfieldvalue>
    <customfieldvalue id="7536">Execution EMEA Team 2023-07-24</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|i1ay1z:</customfieldvalue>

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