<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:10:33 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-46118] Make migration_util helpers save the repl set term before finalizing migration</title>
                <link>https://jira.mongodb.org/browse/SERVER-46118</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Instead of saving it right before every step:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/56721bbc268e137a20974d9b6d880caaca189541/src/mongo/db/s/migration_util.cpp#L452&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/56721bbc268e137a20974d9b6d880caaca189541/src/mongo/db/s/migration_util.cpp#L452&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/blob/56721bbc268e137a20974d9b6d880caaca189541/src/mongo/db/s/migration_util.cpp#L514&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/blob/56721bbc268e137a20974d9b6d880caaca189541/src/mongo/db/s/migration_util.cpp#L514&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="1145360">SERVER-46118</key>
            <summary>Make migration_util helpers save the repl set term before finalizing migration</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="randolph@mongodb.com">Randolph Tan</assignee>
                                    <reporter username="randolph@mongodb.com">Randolph Tan</reporter>
                        <labels>
                    </labels>
                <created>Wed, 12 Feb 2020 22:37:55 +0000</created>
                <updated>Wed, 25 Mar 2020 19:30:48 +0000</updated>
                            <resolved>Fri, 28 Feb 2020 21:08:32 +0000</resolved>
                                                                    <component>Sharding</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="2999779" author="esha.maharishi@10gen.com" created="Wed, 25 Mar 2020 19:30:48 +0000"  >&lt;p&gt;When I did the write-up above, I missed that the &quot;term check&quot; also &lt;a href=&quot;https://github.com/mongodb/mongo/blob/cec8d6e7b6b3191020b8c00e498b64ddc0824586/src/mongo/db/s/migration_util.cpp#L170&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;checks if the node is primary&lt;/a&gt;, meaning the local writes will not keep getting retried if the node is secondary.&lt;/p&gt;

&lt;p&gt;I amended &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47012&quot; title=&quot;Make it more obvious that retryIdempotentWorkUntilSuccess will stop retrying if the node has stepped down&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47012&quot;&gt;&lt;del&gt;SERVER-47012&lt;/del&gt;&lt;/a&gt; to just make it more obvious that this is the case.&lt;/p&gt;</comment>
                            <comment id="2989154" author="esha.maharishi@10gen.com" created="Fri, 20 Mar 2020 15:34:30 +0000"  >&lt;p&gt;Filed &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-47012&quot; title=&quot;Make it more obvious that retryIdempotentWorkUntilSuccess will stop retrying if the node has stepped down&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-47012&quot;&gt;&lt;del&gt;SERVER-47012&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2989145" author="esha.maharishi@10gen.com" created="Fri, 20 Mar 2020 15:31:11 +0000"  >&lt;p&gt;Per stakeholder demo, the &quot;retrying indefinitely while secondary&quot; bug is bad enough that we should try to fix it, particularly because &lt;a href=&quot;https://github.com/mongodb/mongo/blob/5ab625013bcf6438515dceb5fe7c2228257cb863/src/mongo/db/s/migration_util.cpp#L187-L188&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;a warning message will keep being logged&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="2987880" author="esha.maharishi@10gen.com" created="Thu, 19 Mar 2020 17:41:23 +0000"  >&lt;p&gt;For more context:&lt;/p&gt;

&lt;p&gt;If the term is saved at the beginning of each operation&apos;s loop, the operation must be safe to execute if the term changed just before the term was saved.&lt;/p&gt;

&lt;p&gt;There are two important cases:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;The node stepped down just before the term was saved, meaning the operation must be safe to execute while the node is not primary.&lt;/li&gt;
	&lt;li&gt;The node stepped down and back up just before the term was saved, meaning the operation must be safe to execute concurrently with an identical operation that was spawned as part of stepup recovery.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Here are all the operations run in the loop currently, and why they are safe in both cases:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4d87339d4b427966b9b9fcf879c17bef08437f94/src/mongo/db/s/migration_util.cpp#L496&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;persistCommitDecision&lt;/a&gt; / &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4d87339d4b427966b9b9fcf879c17bef08437f94/src/mongo/db/s/migration_util.cpp#L517&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;persistAbortDecision&lt;/a&gt; / &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4d87339d4b427966b9b9fcf879c17bef08437f94/src/mongo/db/s/migration_util.cpp#L565&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;deleteRangeDeletionTaskLocally&lt;/a&gt; / &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4d87339d4b427966b9b9fcf879c17bef08437f94/src/mongo/db/s/migration_util.cpp#L647&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;markAsReadyRangeDeletionLocally&lt;/a&gt; /&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4d87339d4b427966b9b9fcf879c17bef08437f94/src/mongo/db/s/migration_util.cpp#L666&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;deleteMigrationCoordinatorDocLocally&lt;/a&gt;: does a write on the local node&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;
	&lt;ul&gt;
		&lt;li&gt;If the node &lt;em&gt;stepped down&lt;/em&gt; just before the term was saved, the write or waiting for writeConcern will fail. **&lt;b&gt;I think this means the write will keep getting retried indefinitely while the node is secondary, because the term check will keep passing.&lt;/b&gt;&lt;/li&gt;
		&lt;li&gt;If the node &lt;em&gt;stepped down and up&lt;/em&gt; just before the term was saved, the operation will succeed because the node is primary again, but that&apos;s ok because the write is idempotent.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4d87339d4b427966b9b9fcf879c17bef08437f94/src/mongo/db/s/migration_util.cpp#L538&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;deleteRangeDeletionTaskOnRecipient&lt;/a&gt; / &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4d87339d4b427966b9b9fcf879c17bef08437f94/src/mongo/db/s/migration_util.cpp#L585&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;markAsReadyRangeDeletionTaskOnRecipient&lt;/a&gt; / &lt;a href=&quot;https://github.com/mongodb/mongo/blob/4d87339d4b427966b9b9fcf879c17bef08437f94/src/mongo/db/s/migration_util.cpp#L674&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;ensureChunkVersionIsGreaterThan&lt;/a&gt;: sends a remote write (not a retryable write)
	&lt;ul&gt;
		&lt;li&gt;This write is to communicate a decision that was made durable already, and the write is idempotent, so is fine.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4d87339d4b427966b9b9fcf879c17bef08437f94/src/mongo/db/s/migration_util.cpp#L616&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;advanceTransactionOnRecipient&lt;/a&gt;: sends a remote dummy retryable write to bump the remote node&apos;s txnNumber for the session
	&lt;ul&gt;
		&lt;li&gt;Bumping a transaction number is idempotent, so is fine.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/4d87339d4b427966b9b9fcf879c17bef08437f94/src/mongo/db/s/migration_util.cpp#L716&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;refreshFilteringMetadataUntilSuccess&lt;/a&gt;: does a cache refresh
	&lt;ul&gt;
		&lt;li&gt;Since the cache refresh protocol is different for a primary and secondary, this is actually vulnerable to the bug described in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-45646&quot; title=&quot;If a filtering metadata refresh is scheduled while a node is secondary and there is no primary, then the node becomes primary, the refresh can deadlock with itself&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-45646&quot;&gt;&lt;del&gt;SERVER-45646&lt;/del&gt;&lt;/a&gt;.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="2918502" author="esha.maharishi@10gen.com" created="Fri, 28 Feb 2020 21:08:32 +0000"  >&lt;p&gt;Closing as Won&apos;t Fix since we will instead do &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-46395&quot; title=&quot;Resumable range deleter can submit duplicate range deletion tasks on step up&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-46395&quot;&gt;&lt;del&gt;SERVER-46395&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1283722">SERVER-47012</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>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 28 Feb 2020 21:08:32 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 46 weeks 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-812</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>esha.maharishi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 46 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
            <customfieldvalue>randolph@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hwq8jz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hr6qlb:</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="3572">Sharding 2020-02-24</customfieldvalue>
    <customfieldvalue id="3653">Sharding 2020-03-09</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|hwputb:</customfieldvalue>

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