<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:44:18 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-58361] Reduce access to SSCCL&apos;s persisted collection metadata</title>
                <link>https://jira.mongodb.org/browse/SERVER-58361</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The &lt;tt&gt;dropChunksAndDeleteCollectionsEntry&lt;/tt&gt; function of the the Shard Server Catalog Cache Loader (SSCCL) module requires some information from the collection to drop the related chunks (i.e., UUID and supporting long name status), so it calls the &lt;tt&gt;readShardCollectionsEntry&lt;/tt&gt; function to read the collection entry from disk.&lt;/p&gt;

&lt;p&gt;The idea is to pass this information to the &lt;tt&gt;dropChunksAndDeleteCollectionsEntry&lt;/tt&gt; function as arguments to avoid further and expensive access to the disk.&lt;/p&gt;

&lt;p&gt;This comes from &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-34632&quot; title=&quot;config.chunks change to config.cache.chunks creates a collection long name after upgrade&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-34632&quot;&gt;SERVER-34632&lt;/a&gt;&apos;s &lt;a href=&quot;https://mongodbcr.appspot.com/798010001/diff/775620001/src/mongo/db/s/shard_metadata_util.cpp#newcode420&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;code review&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1811776">SERVER-58361</key>
            <summary>Reduce access to SSCCL&apos;s persisted collection metadata</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="kaloian.manassiev@mongodb.com">Kaloian Manassiev</assignee>
                                    <reporter username="antonio.fuschetto@mongodb.com">Antonio Fuschetto</reporter>
                        <labels>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Thu, 8 Jul 2021 07:09:06 +0000</created>
                <updated>Fri, 17 Sep 2021 14:06:03 +0000</updated>
                            <resolved>Fri, 17 Sep 2021 14:06:03 +0000</resolved>
                                                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="4029718" author="JIRAUSER1259062" created="Mon, 30 Aug 2021 17:41:03 +0000"  >&lt;p&gt;The following diagram shows all read and write operations on the persisted collection metadata (i.e., &lt;tt&gt;system.cache.collections&lt;/tt&gt;) performed by the SSCCL&apos;s&#160;&lt;tt&gt;getChunksSince&lt;/tt&gt; function:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://jira.mongodb.org/secure/attachment/332614/332614_SSCCL%27s+activities+on+system.cache.collections.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;This analysis highlights (again) that the number &lt;em&gt;read&lt;/em&gt; operations could be optimized just considering the corner cases. This also highlights a similar situation for the&#160;&lt;em&gt;write&lt;/em&gt; operations where, probably, might make sense to investigare a bit more on the logic around the refreshing flag (it appears that the collection is marked as refreshing until the write operations on the chunks are completed as well).&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=kaloian.manassiev&quot; class=&quot;user-hover&quot; rel=&quot;kaloian.manassiev&quot;&gt;kaloian.manassiev&lt;/a&gt;, please let me know if you see any areas for improvement that I am ignoring or if this task can be rejected.&lt;/p&gt;</comment>
                            <comment id="4026653" author="JIRAUSER1259062" created="Fri, 27 Aug 2021 15:34:43 +0000"  >&lt;p&gt;The &lt;a href=&quot;https://github.com/10gen/mongo/blob/df329d8f46e1485dd5d70379f9c48bf4175f0d5a/src/mongo/db/s/shard_metadata_util.cpp#L443&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;dropChunksAndDeleteCollectionsEntry&lt;/a&gt; function, which reads the metadata from disk,&#160;is invoked in three contexts:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;By the &lt;a href=&quot;https://github.com/10gen/mongo/blob/789c686a8c6d5d05f501406d54c611bca1266e6e/src/mongo/db/s/shard_server_catalog_cache_loader.cpp#L206&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;getPersistedMaxChunkVersionAndLastestSupportingLongName&lt;/a&gt; function when the cached collection in refreshing status (corner case). In this scenario, the persisted metadata has been already read and could be potentially reused. This happens in the parent thread.&lt;/li&gt;
	&lt;li&gt;By the &lt;a href=&quot;https://github.com/10gen/mongo/blob/789c686a8c6d5d05f501406d54c611bca1266e6e/src/mongo/db/s/shard_server_catalog_cache_loader.cpp#L78&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;_updatePersistedCollAndChunksMetadata&lt;/a&gt; and &lt;a href=&quot;https://github.com/10gen/mongo/blob/789c686a8c6d5d05f501406d54c611bca1266e6e/src/mongo/db/s/shard_server_catalog_cache_loader.cpp#L1277&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;persistCollectionAndChangedChunks&lt;/a&gt; functions, which are called in mutual exclusion in a different thread (a worker thread of a pool). In this scenario it&apos;s crucial to read the metadata from disk instead from task because the information could be stale (e.g., &lt;tt&gt;supportLongName&lt;/tt&gt; status). In fact, the needed information cannot be read from the task as it may have changed since the task was added to the queue.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;In conclusion, since the &lt;a href=&quot;https://github.com/10gen/mongo/blob/df329d8f46e1485dd5d70379f9c48bf4175f0d5a/src/mongo/db/s/shard_metadata_util.cpp#L443&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;dropChunksAndDeleteCollectionsEntry&lt;/a&gt; function is not used in the same thread and multiple times, after a deeper analysis I don&apos;t see a great value in refactoring the existing implementation. The risk is to further complicate an already complicated module, where the actual improvement applies to point 1 above, which represents a case case.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="332614" name="SSCCL&apos;s activities on system.cache.collections.png" size="45370" author="antonio.fuschetto@mongodb.com" created="Mon, 30 Aug 2021 17:27:47 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.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_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 23 weeks, 2 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_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>connie.chen@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 23 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>antonio.fuschetto@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|hzr29j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzjwwn:</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="4981">Sharding EMEA 2021-07-26</customfieldvalue>
    <customfieldvalue id="5178">Sharding EMEA 2021-08-09</customfieldvalue>
    <customfieldvalue id="5179">Sharding EMEA 2021-08-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|hzqoin:</customfieldvalue>

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