<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:35:16 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-55032] Get rid of ShardingStateRecovery once 5.0 branches out </title>
                <link>https://jira.mongodb.org/browse/SERVER-55032</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;The &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/sharding_state_recovery.h&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ShardingStateRecovery&lt;/a&gt; machinery can be fully replaced by the &lt;tt&gt;waitFor*&lt;/tt&gt; and &lt;tt&gt;recovery&lt;/tt&gt; methods offered by the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/164f7ba0dee2a6d21107adb4f7af3bfb64d43177/src/mongo/db/vector_clock_mutable.h#L81-L95&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;VectorClockMutable&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1643235">SERVER-55032</key>
            <summary>Get rid of ShardingStateRecovery once 5.0 branches out </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="12300">Won&apos;t Do</resolution>
                                        <assignee username="backlog-server-sharding-emea">[DO NOT USE] Backlog - Sharding EMEA</assignee>
                                    <reporter username="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</reporter>
                        <labels>
                            <label>5.0-cleanup</label>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Mon, 8 Mar 2021 14:42:12 +0000</created>
                <updated>Mon, 5 Dec 2022 20:25:23 +0000</updated>
                            <resolved>Tue, 21 Sep 2021 15:06:47 +0000</resolved>
                                                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4113501" author="xgen-internal-githook" created="Fri, 8 Oct 2021 17:35:21 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Kaloian Manassiev&apos;, &apos;email&apos;: &apos;kaloian.manassiev@mongodb.com&apos;, &apos;username&apos;: &apos;kaloianm&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60126&quot; title=&quot;Complete TODO listed in SERVER-55032&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60126&quot;&gt;&lt;del&gt;SERVER-60126&lt;/del&gt;&lt;/a&gt; Swap TODO &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-55032&quot; title=&quot;Get rid of ShardingStateRecovery once 5.0 branches out &quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-55032&quot;&gt;&lt;del&gt;SERVER-55032&lt;/del&gt;&lt;/a&gt; with &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60110&quot; title=&quot;Get rid of ShardingStateRecovery once 7.0 branches out&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60110&quot;&gt;&lt;del&gt;SERVER-60110&lt;/del&gt;&lt;/a&gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/91da50fc2c4cd81486d8a4a9fd220c43ef7f6ddd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/91da50fc2c4cd81486d8a4a9fd220c43ef7f6ddd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4074472" author="pierlauro.sciarelli" created="Tue, 21 Sep 2021 15:06:47 +0000"  >&lt;p&gt;Closing because of the reasons explained in the comment.&lt;/p&gt;

&lt;p&gt;Opened &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60109&quot; title=&quot;Ensure vector clock is recovered on step-up&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60109&quot;&gt;&lt;del&gt;SERVER-60109&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-60110&quot; title=&quot;Get rid of ShardingStateRecovery once 7.0 branches out&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-60110&quot;&gt;&lt;del&gt;SERVER-60110&lt;/del&gt;&lt;/a&gt; to follow up.&lt;/p&gt;</comment>
                            <comment id="3995361" author="JIRAUSER1257318" created="Wed, 11 Aug 2021 16:03:25 +0000"  >&lt;p&gt;ShardingStateRecovery cannot yet be thrown out on 5.1.&lt;/p&gt;

&lt;p&gt;Some context first: ShardingStateRecovery does the following on stepup&lt;br/&gt;
 a. If there is no active &apos;metadata operation&apos; ongoing, it &lt;a href=&quot;https://github.com/mongodb/mongo/blob/74f795cdebd943bf8d6a56005dde4e2189cfb76e/src/mongo/db/s/sharding_state_recovery.cpp#L244-L246&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;recovers the configOpTime&lt;/a&gt; persisted in the &lt;tt&gt;minOpTimeRecovery&lt;/tt&gt; document.&lt;br/&gt;
 b. If there was any active &apos;metadata operation&apos; ongoing, it &lt;a href=&quot;https://github.com/mongodb/mongo/blob/74f795cdebd943bf8d6a56005dde4e2189cfb76e/src/mongo/db/s/sharding_state_recovery.cpp#L260-L265&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;essentially does a linearizable read onto the configsvr&lt;/a&gt; which then advances the local knowledge of the configTime to that gossiped in the &quot;linearizable read&quot; response.&lt;/p&gt;

&lt;p&gt;Currently, ShardingStateRecovery is critical for the correctness of these two operations: chunk migration and movePrimary.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Chunk migration: Before the donor &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fca4506a72e32e2346ddaa7e0a7d9d59f2138d8e/src/mongo/db/s/migration_source_manager.cpp#L733&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;writes the migration decision&lt;/a&gt; on the migrationCoordinator document, it is necessary that we &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fca4506a72e32e2346ddaa7e0a7d9d59f2138d8e/src/mongo/db/s/migration_source_manager.cpp#L727&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;durably persist a configTime that is inclusive of the migration commit&lt;/a&gt;. This ensures that in case of donor failover, the new primary will know of a configTime inclusive of the migration. This is relevant in failovers that happen when either the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/35833cbe9c2ff2e44792103de95971668a94a637/src/mongo/db/s/migration_util.cpp#L992-L994&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;migration decision has been made durable&lt;/a&gt;, or in cases where the coordinatorDocument has already been deleted.&lt;br/&gt;
 In case of failovers that happen when the migrationDecision has not been yet set, notice that the new primary essentially does a linearizable read onto the configsvr &lt;a href=&quot;https://github.com/mongodb/mongo/blob/35833cbe9c2ff2e44792103de95971668a94a637/src/mongo/db/s/migration_util.cpp#L999-L1003&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here in ensureChunkVersionIsGreaterThan&lt;/a&gt;, which will recover a configTime inclusive of any possible commit the previous primary did. This is to explain that for migrations, we don&apos;t really need the guarantee (b) of ShardingStateRecovery. We are just interested on (a).&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;MovePrimary: MovePrimary does not implement any custom recovery logic, so it relies on both guarantees from ShardingStateRecovery.&lt;/li&gt;
&lt;/ul&gt;


&lt;hr /&gt;
&lt;p&gt;The guarantee (a) could be replaced by the &lt;tt&gt;VectorClock::waitForDurableConfigTime&lt;/tt&gt;. This way, ShardingStateRecovery would no longer need to make configOpTime durable, and instead we&apos;ll rely on the VectorClock recovery. ShardingStateRecovery would still be needed for guarantee (b) required by movePrimary.&lt;/p&gt;

&lt;p&gt;However, it is not possible to throw away (a) in 5.1. The reason is that in multi-version clusters (5.0 &amp;lt;--&amp;gt; 5.1), we never &lt;a href=&quot;https://github.com/mongodb/mongo/blob/35833cbe9c2ff2e44792103de95971668a94a637/src/mongo/db/vector_clock_mutable.h#L95&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;recover&lt;/a&gt; the VectorClock on stepup. Because of that, the following situations could happen:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;A v5.0 migration donor (only &lt;a href=&quot;https://github.com/mongodb/mongo/blob/fca4506a72e32e2346ddaa7e0a7d9d59f2138d8e/src/mongo/db/s/migration_source_manager.cpp#L727&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;durably persists configOpTime through the ShardingStateRecovery&lt;/a&gt;) stepsdown. A v5.1 secondary steps up, attempts to recover the configTime only through the VectorClock, so it won&apos;t see the ShardingStateRecovery&apos;s configOpTime. (Albeit this one could be addressed by keeping the ShardingStateRecovery&apos;s recovery of configOpTime in 5.1)&lt;/li&gt;
	&lt;li&gt;A v5.1 migration donor (consider we make it only durably persists configTime through VectorClock) stepsdown. A v5.0 primary steps up, but since it only recovers the ShardingStateRecovery&apos;s configOpTime it won&apos;t see the persisted time in vectorClock.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Similar reasoning should apply to movePrimary&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Possible course of action:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;On v5.1
	&lt;ul&gt;
		&lt;li&gt;Run VectorClock::recover() (in addition to the ShardingStateRecovery::recover()) on &lt;a href=&quot;https://github.com/mongodb/mongo/blob/35833cbe9c2ff2e44792103de95971668a94a637/src/mongo/db/repl/replication_coordinator_external_state_impl.cpp#L893&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;stepup&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;In ShardingStateRecovery::endMetadataOp(), also make configTime durable on VectorClock&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;On v6.1
	&lt;ul&gt;
		&lt;li&gt;Change migration to no longer use ShardingStateRecovery and use just VectorClock::waitDurable&lt;/li&gt;
		&lt;li&gt;ShardingStateRecovery no longer reads or updates it&apos;s own configOpTime (we can just rely on VectorClock now)&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;

</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                        <issuelink>
            <issuekey id="1423809">SERVER-49973</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="1879972">SERVER-60126</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1879689">SERVER-60109</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1879690">SERVER-60110</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.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="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>Wed, 11 Aug 2021 16:03:25 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 17 weeks, 5 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-2423</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, 17 weeks, 5 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>backlog-server-sharding-emea</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>jordi.serra-torrens@mongodb.com</customfieldvalue>
            <customfieldvalue>pierlauro.sciarelli@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyyi7r:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6qp3:</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="5425">Sharding EMEA 2021-10-18</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|hyy4gv:</customfieldvalue>

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