<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:22:01 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-50189] Replace ReplicaSetMonitorManager::removeMonitor with a custom deleter for shared_ptr&lt;ReplicaSetMonitor&gt;</title>
                <link>https://jira.mongodb.org/browse/SERVER-50189</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;ReplicaSetMonitorManager stores ReplicaSetMonitors&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/c02549a7a7c103ba352d90cb33d195ba7cb27455/src/mongo/client/replica_set_monitor_manager.h#L158&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;by weak_ptr&lt;/a&gt; so that the ReplicaSetMonitor is destroyed when the last shared_ptr reference to it goes out of scope.&lt;/p&gt;

&lt;p&gt;However, ReplicaSetMonitorManager also has a&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/c02549a7a7c103ba352d90cb33d195ba7cb27455/src/mongo/client/replica_set_monitor_manager.h#L122&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;removeMonitor&lt;/a&gt; function, which currently the holder of the last shared_ptr reference has to call to remove the entry for the ReplicaSetMonitor from the ReplicaSetMonitorManager&apos;s map.&lt;/p&gt;

&lt;p&gt;Instead, the shared_ptr to ReplicaSetMonitor could be&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/c02549a7a7c103ba352d90cb33d195ba7cb27455/src/mongo/client/replica_set_monitor_manager.cpp#L187-L200&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;created&lt;/a&gt; with a custom deleter that removes the entry from the map, like:&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;   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;        std::shared_ptr&amp;lt;Foo&amp;gt; sh5(new Foo, [](auto p) {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;           std::cout &amp;lt;&amp;lt; &quot;Call delete from lambda...\n&quot;;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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;   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;           delete p;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&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-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;        });&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;See also &lt;a href=&quot;https://en.cppreference.com/w/cpp/memory/shared_ptr/shared_ptr&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://en.cppreference.com/w/cpp/memory/shared_ptr/shared_ptr&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There are a couple complications:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;We probably still want to remove the hosts from the connection pool, which ReplicaSetMonitor::remove currently &lt;a href=&quot;https://github.com/mongodb/mongo/blob/c02549a7a7c103ba352d90cb33d195ba7cb27455/src/mongo/client/replica_set_monitor.cpp#L80-L86&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;does&lt;/a&gt;.&lt;/li&gt;
	&lt;li&gt;There are two implementations of ReplicaSetMonitor, and the Streamable implementation has a&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/c02549a7a7c103ba352d90cb33d195ba7cb27455/src/mongo/client/replica_set_monitor_manager.cpp#L198&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;factory method&lt;/a&gt; to create its monitors.&lt;/li&gt;
&lt;/ol&gt;
</description>
                <environment></environment>
        <key id="1435687">SERVER-50189</key>
            <summary>Replace ReplicaSetMonitorManager::removeMonitor with a custom deleter for shared_ptr&lt;ReplicaSetMonitor&gt;</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="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="backlog-server-cluster-scalability">Backlog - Cluster Scalability</assignee>
                                    <reporter username="esha.maharishi@mongodb.com">Esha Maharishi</reporter>
                        <labels>
                            <label>sharding-common-backlog</label>
                            <label>sharding-nyc-subteam2</label>
                    </labels>
                <created>Fri, 7 Aug 2020 22:28:26 +0000</created>
                <updated>Tue, 12 Dec 2023 15:53:23 +0000</updated>
                                                                            <component>Replication</component>
                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3435454" author="JIRAUSER1256988" created="Thu, 8 Oct 2020 20:14:13 +0000"  >&lt;p&gt;I&apos;m trying this again but with only minimal changes:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;just remove the circular dependency by fixing the&#160;TopologyListenerPtr to weak pointer&lt;/li&gt;
	&lt;li&gt;do not use custom deleter because it will be lost when &apos;shared_from_this()&apos; is invoked&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;And I expect a lot of tests to fail, which could be hard to fix but unfortunately cleaning up the circular dependency is inevitable one day anyway&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Test failures so far:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://spruce.mongodb.com/version/5f7f846c3e8e864890e64103/tasks&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://spruce.mongodb.com/version/5f7f846c3e8e864890e64103/tasks&lt;/a&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://logkeeper.mongodb.org/lobster/build/4f137323c6d502618c61ba4f27fcc070/test/5f7f9c6abe07c43e035aab6e#bookmarks=0%2C66418&amp;amp;l=1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://logkeeper.mongodb.org/lobster/build/4f137323c6d502618c61ba4f27fcc070/test/5f7f9c6abe07c43e035aab6e#bookmarks=0%2C66418&amp;amp;l=1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://logkeeper.mongodb.org/lobster/build/9112ca0fd22ae6e23222cd8a06e33584/test/5f7f9e5f9041306a554a92db#l=1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://logkeeper.mongodb.org/lobster/build/9112ca0fd22ae6e23222cd8a06e33584/test/5f7f9e5f9041306a554a92db#l=1&lt;/a&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;The error is during the shutdown, key log entry:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;js_test:migration_coordinator_abort_failover&amp;#93;&lt;/span&gt; 2020-10-09T03:23:45.085+0000 s20027| 2020-10-09T03:23:45.084+00:00 W SHARDING 22667 &lt;span class=&quot;error&quot;&gt;&amp;#91;SignalHandler&amp;#93;&lt;/span&gt; &quot;Error cleaning up distributed ping entry&quot;,&quot;attr&quot;:&lt;/p&gt;
{&quot;processId&quot;:&quot;ip-10-122-13-53:20027:1602213643:-6029069255033399232&quot;,&quot;error&quot;:&quot;ReplicaSetMonitorRemoved: ReplicaSetMonitor for set migration_coordinator_abort_failover-configRS is removed&quot;}
&lt;p&gt;&#160;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="1507395">SERVER-51440</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1429373">SERVER-50093</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1449283">SERVER-50467</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1507413">SERVER-51442</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1507416">SERVER-51443</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1507395">SERVER-51440</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_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="26583"><![CDATA[Cluster Scalability]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 24 Aug 2020 14:51:13 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 17 weeks, 6 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>dbeng-pm-bot</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 17 weeks, 6 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>andrew.shuvalov@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-cluster-scalability</customfieldvalue>
            <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hxzamn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxdfl3:</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="4137">Sharding 2020-08-24</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10555" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </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|hxywvz:</customfieldvalue>

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