<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:54:54 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-62355] Add mapping from collection namespace to Op Observer</title>
                <link>https://jira.mongodb.org/browse/SERVER-62355</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;When an operation occurs, the code go through all the OpObserver and invokes them so they can apply some added logic if needed.&lt;/p&gt;

&lt;p&gt;As multiple OpObservers simply check if the collection is equal to a constant value. Creating a type of observer that&apos;s bound to a specific collection would allow usage of a map instead of iterating through all observers.&lt;/p&gt;

&lt;p&gt;A new mechanism to bind such an observer could be something similar to :&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; &#160; &#160;&lt;/span&gt;&lt;span style=&quot;color: #006699; font-weight: bold; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; addObserver(std::string CollectionNamespace, std::unique_ptr&amp;lt;OpObserver&amp;gt; observer)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;This would allow usage of a map to avoid iterating though all the observers.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1958473">SERVER-62355</key>
            <summary>Add mapping from collection namespace to Op Observer</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="backlog-server-serverless">[DO NOT USE] Backlog - Server Serverless</assignee>
                                    <reporter username="didier.nadeau@mongodb.com">Didier Nadeau</reporter>
                        <labels>
                    </labels>
                <created>Tue, 4 Jan 2022 21:05:27 +0000</created>
                <updated>Tue, 6 Dec 2022 00:41:48 +0000</updated>
                            <resolved>Mon, 7 Feb 2022 20:47:34 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="4340526" author="JIRAUSER1262830" created="Mon, 7 Feb 2022 20:47:35 +0000"  >&lt;p&gt;As it turns out the performance issue was not with the vector itself, but rather with the observer (using a map &quot;fixed&quot; the issue by avoiding calls to the observer&apos;s code). This issue will be fixed within the observer&apos;s code itself instead.&lt;/p&gt;

&lt;p&gt;Currently there is likely no benefit to using a map as only 2 observers are bound to a single namespace (tmrs&apos; observer was recently modified and is now watching multiple namespaces). With so few observers and no plan to add anymore at the moment, we will not use an observer map.&lt;/p&gt;</comment>
                            <comment id="4335662" author="louis.williams" created="Fri, 4 Feb 2022 12:58:08 +0000"  >&lt;p&gt;Thanks, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=didier.nadeau&quot; class=&quot;user-hover&quot; rel=&quot;didier.nadeau&quot;&gt;didier.nadeau&lt;/a&gt;! Since it appears as though you have a working solution, I&apos;m going to assign this to Server Serverless to schedule and investigate further. Please add me as a reviewer.&lt;/p&gt;</comment>
                            <comment id="4334889" author="JIRAUSER1262830" created="Thu, 3 Feb 2022 22:52:15 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=louis.williams&quot; class=&quot;user-hover&quot; rel=&quot;louis.williams&quot;&gt;louis.williams&lt;/a&gt;, I am reopening this ticket as performance BF-24189 was raised following &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61772&quot; title=&quot;Implement tenant access blocking for the split service&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61772&quot;&gt;&lt;del&gt;SERVER-61772&lt;/del&gt;&lt;/a&gt;. I have tried a test implementation of the observer map and it does seem to improve performance : &lt;a href=&quot;https://jira.mongodb.org/browse/BF-24189?focusedCommentId=4334710&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-4334710&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/BF-24189?focusedCommentId=4334710&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-4334710&lt;/a&gt;. I am running a few more tests and will comment again on this.&lt;/p&gt;</comment>
                            <comment id="4308939" author="louis.williams" created="Mon, 24 Jan 2022 12:06:15 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=didier.nadeau&quot; class=&quot;user-hover&quot; rel=&quot;didier.nadeau&quot;&gt;didier.nadeau&lt;/a&gt;, while I agree that the proposed API makes sense, the performance motivation, which I understand is the reason for filing this ticket, doesn&apos;t seem strong enough to warrant such a change.&lt;/p&gt;

&lt;p&gt;My belief is that unless the performance impact can be shown, this is not a performance problem until proven otherwise. OpObservers can show up in perf, but not because of the string comparisons. They&apos;re expensive because they perform extra writes, acquire locks, etc. But memcmp() is an extremely efficient operation, often optimized down to the processor level.&lt;/p&gt;

&lt;p&gt;The number of OpObservers is low enough (I counted 9 on a shard server), that I don&apos;t see the map solution as a clear win over the current implementation. The&#160;cost of maintaining a map from every namespace to a set of OpObservers seems pretty high. I can think of a simple implementation that registers the same set of OpObservers for every single namespace. This has obvious problems such as space and code complexity. If the map uses hashing, it might be more costly than a few small string comparisons. If the map uses a tree, then we would have chase pointers, which is also costly and cache-inefficient.&lt;/p&gt;

&lt;p&gt;To iterate on this solution, we could maintain a set of &quot;common&quot; observers (what we have today) in addition to a map for namespace-specific observers. But I see this as having a similar problem: each OpObserver now has to perform a map lookup in addition to iterating through the common observers.&lt;/p&gt;

&lt;p&gt;If you disagree, and this does in fact show up significantly in perf, please feel free to reopen. Additionally, if we see a significant increase in the usage of OpObservers for specific namespaces, perhaps we can reconsider this change.&#160;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</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="25131"><![CDATA[Serverless]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 24 Jan 2022 12:06:15 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-2357</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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-serverless</customfieldvalue>
            <customfieldvalue>didier.nadeau@mongodb.com</customfieldvalue>
            <customfieldvalue>louis.williams@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i0fxg7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr2n7b:</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="5670">Server Serverless 2022-01-10</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|i0fjlj:</customfieldvalue>

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