<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:33:26 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-54402] CollectionShardingState and DatabaseShardingState should return immutable const references for lock-free read operations</title>
                <link>https://jira.mongodb.org/browse/SERVER-54402</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;This was attempted in&#160;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-51319&quot; title=&quot;Check DatabaseShardingState::checkDbVersion after acquiring a storage snapshot for AutoGetCollection*LFR&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-51319&quot;&gt;&lt;del&gt;SERVER-51319&lt;/del&gt;&lt;/a&gt;. However, there are existing interface obstructions wherein const CSS and DSS instances are not accepted and&#160;accommodation must be made: for example, the CSSLock related code interface needs expansion to accept const instances. Currently the lock-free read access functions are called &lt;tt&gt;DSS/CSS::getSharedForLockFreeReads():&lt;/tt&gt;&#160;they should return a const object.&lt;/p&gt;

&lt;p&gt;This would prevent ostensible readers from running &lt;tt&gt;CSS&lt;/tt&gt;&#160;functions that may modify the &lt;tt&gt;CSS&lt;/tt&gt;&#160;or other sub-state, which is not currently protected against. Sharding may want to consider changes to the &lt;tt&gt;CSS&lt;/tt&gt;&#160;and/or &lt;tt&gt;DSS&lt;/tt&gt;&#160;classes and subsystems such that there can be const readers and non-const writers such that readers will not be allowed/able to do something they should not by accident.&lt;/p&gt;

&lt;p&gt;-----------------------------------------------------------------------------&lt;/p&gt;

&lt;p&gt;Some context-y notes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Query has a use case for doing an aggregation on a view namespace wherein they must check whether the underlying collection is sharded or not &#8212; an optimization to reduce round trips between mongos and shard. Aggregation is running lock-free, so I recommended using &lt;tt&gt;CSS::getSharedForLockFreeReads()&lt;/tt&gt;&#160;that bypasses the collection lock requirements for lock-free read operations. It seems likely that we will have an increasing need to access the &lt;tt&gt;CSS&lt;/tt&gt;&#160;without collection locks, especially down the line when Execution runs more projects to remove locks from more operations.&lt;/li&gt;
	&lt;li&gt;The DatabaseShardingState and CollectionShardingState classes are considered global and unversioned state, I believe, merely accessors for various sharding state. Therefore, it would be best to be able to safely fetch versioned state THROUGH the DSS and CSS objects, to then stash for a lock-free read operation to use until finished.
	&lt;ul&gt;
		&lt;li&gt;An alternative would be to make these classes copy-on-write, so a lock-free read can grab a versioned instance of the &lt;tt&gt;CSS&lt;/tt&gt;&#160;or &lt;tt&gt;DSS&lt;/tt&gt;, but that doesn&#8217;t seem desirable from past conversations.&lt;/li&gt;
		&lt;li&gt;As a note, the execution layer &lt;tt&gt;Collection&lt;/tt&gt;&#160;class is copy-on-write and can have several &lt;tt&gt;Collection&lt;/tt&gt;&#160;instances for a single collection. Furthermore, a &lt;tt&gt;Collection&lt;/tt&gt;&#160;instance can have versioned decorations OR unversioned shared decorations via decorating the &lt;tt&gt;ShardCollectionDecorations&lt;/tt&gt;&#160;that exists as shared state across all &lt;tt&gt;Collection&lt;/tt&gt;&#160;instances for a single collection.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="1616491">SERVER-54402</key>
            <summary>CollectionShardingState and DatabaseShardingState should return immutable const references for lock-free read operations</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="backlog-server-sharding-emea">[DO NOT USE] Backlog - Sharding EMEA</assignee>
                                    <reporter username="dianna.hohensee@mongodb.com">Dianna Hohensee</reporter>
                        <labels>
                            <label>PM-2144-Milestone-0</label>
                    </labels>
                <created>Mon, 8 Feb 2021 19:23:48 +0000</created>
                <updated>Tue, 30 May 2023 16:09:29 +0000</updated>
                            <resolved>Tue, 30 May 2023 16:09:29 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="5460869" author="kaloian.manassiev" created="Tue, 30 May 2023 16:09:29 +0000"  >&lt;p&gt;As part of this project we are going in the direction of hiding the DSS/CSS, so this ticket is now unnecessary.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10520">
                    <name>Problem/Incident</name>
                                                                <inwardlinks description="is caused by">
                                        <issuelink>
            <issuekey id="1561202">SERVER-53257</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1499218">SERVER-51319</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>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25133"><![CDATA[Sharding EMEA]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 30 May 2023 16:09:29 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        36 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-2144</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>kaloian.manassiev@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            36 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-sharding-emea</customfieldvalue>
            <customfieldvalue>dianna.hohensee@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|hytyrb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyfhlz:</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_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|hytl0f:</customfieldvalue>

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