<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 06:54:48 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-84361] Check that CreateCollectionCoordinatorLegacy terminates on error</title>
                <link>https://jira.mongodb.org/browse/SERVER-84361</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Check that throwing in&#160;&lt;br/&gt;
CreateCollectionCoordinatorLegacy::_runImpl()&#160;before the coordinator document is persisted by _buildPhaseHandler() does not lead to undead/zombie coordinator instance which is not removed by&#160;PrimaryOnlyServiceOpObserver.&lt;/p&gt;</description>
                <environment></environment>
        <key id="2530299">SERVER-84361</key>
            <summary>Check that CreateCollectionCoordinatorLegacy terminates on error</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="13202">Works as Designed</resolution>
                                        <assignee username="pol.pinol@mongodb.com">Pol Pinol</assignee>
                                    <reporter username="romans.kasperovics@mongodb.com">Romans Kasperovics</reporter>
                        <labels>
                            <label>car-investigation</label>
                    </labels>
                <created>Thu, 21 Dec 2023 00:15:59 +0000</created>
                <updated>Mon, 22 Jan 2024 12:41:30 +0000</updated>
                            <resolved>Mon, 22 Jan 2024 12:41:29 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="6030243" author="JIRAUSER1271605" created="Mon, 22 Jan 2024 12:41:10 +0000"  >&lt;p&gt;I ran a custom test to trigger an exception on the first phase of the legacy coordinator - without buildPhaseHandler, and compared the results with throwing an exception in the following phase kCommit, which is registered by the buildPhaseHandler.&lt;/p&gt;

&lt;p&gt;When throwing an exception, both runs are followed by the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4334bc362ad075dc16cdcf75c7632aa052597cfa/src/mongo/db/s/sharding_ddl_coordinator.cpp#L444&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;.onCompletion&lt;/a&gt; phase of the future chain. After that, as they must return an error, a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4334bc362ad075dc16cdcf75c7632aa052597cfa/src/mongo/db/s/sharding_ddl_coordinator.cpp#L467&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;cleanup&lt;/a&gt; is performed. We can see &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4334bc362ad075dc16cdcf75c7632aa052597cfa/src/mongo/db/s/sharding_ddl_coordinator.cpp#L469-L481&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;these traces of logs&lt;/a&gt; in both runs, which confirm that we are releasing resources.&lt;/p&gt;

&lt;p&gt;The only difference between both runs is where the instance of the coordinator is removed from the registry (config.system.sharding_ddl_coordinators).&lt;/p&gt;

&lt;p&gt;If it has thrown in the first phase, without executing the buildPhaseHandler, the coordinator document will not exist, and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4334bc362ad075dc16cdcf75c7632aa052597cfa/src/mongo/db/s/sharding_ddl_coordinator.cpp#L489-L494&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this&lt;/a&gt; will be executed to remove the instance. &lt;/p&gt;

&lt;p&gt;On the other hand, if the buildPhaseHandler has been executed, we will delete the coordinator document, and the PrimaryOnlyServiceOpObserver will be responsible for &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4334bc362ad075dc16cdcf75c7632aa052597cfa/src/mongo/db/repl/primary_only_service_op_observer.cpp#L77&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;removing the instance from the registry&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Finally, both runs release the remaining resources, i.e. DDL locks.&lt;/p&gt;

&lt;p&gt;To summarize, although they are using different implementations for removing resources, I don&#8217;t see a place where throwing without installing the coord document can lead to zombie coordinator instances. If there are no other concerns, I&apos;m closing this ticket.&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>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="26387"><![CDATA[Catalog and Routing]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 22 Jan 2024 12:41:10 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 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>pol.pinol@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>pol.pinol@mongodb.com</customfieldvalue>
            <customfieldvalue>romans.kasperovics@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i35jzz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i2nb30:</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="8006">CAR Team 2024-01-22</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|i3565b:</customfieldvalue>

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