<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:50:15 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-60599] Count command on mongoq handles TenantMigrationAborted</title>
                <link>https://jira.mongodb.org/browse/SERVER-60599</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;ClusterCountCmd::run &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8076483b5f8b942507ed1dcfb2c4a64b303c1cf5/src/mongo/s/commands/cluster_count_cmd.cpp#L113&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;uses&lt;/a&gt; scatterGatherVersionedTargetByRoutingTable, which &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8076483b5f8b942507ed1dcfb2c4a64b303c1cf5/src/mongo/s/cluster_commands_helpers.cpp#L201-L216&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;throws&lt;/a&gt; on routing errors. The routing error exceptions are &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8076483b5f8b942507ed1dcfb2c4a64b303c1cf5/src/mongo/s/commands/strategy.cpp#L1076-L1083&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;caught&lt;/a&gt; in mongos&apos;s/mongoq&apos;s service entry point, where mongos/mongoq &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8076483b5f8b942507ed1dcfb2c4a64b303c1cf5/src/mongo/s/commands/strategy.cpp#L1006-L1007&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;marks&lt;/a&gt; the appropriate routing cache entry as stale and retries the command by calling that function recursively &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8076483b5f8b942507ed1dcfb2c4a64b303c1cf5/src/mongo/s/commands/strategy.cpp#L1066-L1069&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;until&lt;/a&gt; retries are exhausted.&lt;/p&gt;

&lt;p&gt;This ticket should:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Update scatterGatherVersionedTargetByRoutingTable to also throw on TenantMigrationAborted&lt;/li&gt;
	&lt;li&gt;Update mongos&apos;s/mongoq&apos;s service entry point to recursively call run() on TenantMigrationAborted&lt;/li&gt;
	&lt;li&gt;Add a test that mongos/mongoq retries the count command internally on TenantMigrationAborted.
	&lt;ul&gt;
		&lt;li&gt;The test should be similar to the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/618eef6522349a1502b95727313b7967ca6f199a/jstests/replsets/tenant_migration_concurrent_writes_on_donor.js#L435-L470&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;testRejectBlockedWritesAfterMigrationAborted test case&lt;/a&gt; in that it should:
		&lt;ul&gt;
			&lt;li&gt;set the pauseTenantMigrationBeforeLeavingBlockingState and abortTenantMigrationBeforeLeavingBlockingState failpoints on the replica set primary&lt;/li&gt;
			&lt;li&gt;start a tenant migration against the replica set primary&lt;/li&gt;
			&lt;li&gt;wait for the first failpoint to be hit&lt;/li&gt;
			&lt;li&gt;run the count command&lt;/li&gt;
			&lt;li&gt;wait for the replica set primary to report that it is blocking a read&lt;/li&gt;
			&lt;li&gt;disable the first failpoint to allow the count command to continue&lt;/li&gt;
			&lt;li&gt;assert that the count command worked&lt;/li&gt;
		&lt;/ul&gt;
		&lt;/li&gt;
		&lt;li&gt;However, the test should run the count command against mongos/mongoq instead of against the replica set primary.&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="1895268">SERVER-60599</key>
            <summary>Count command on mongoq handles TenantMigrationAborted</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="mathis.bessa@mongodb.com">Mathis Bessa</assignee>
                                    <reporter username="esha.maharishi@mongodb.com">Esha Maharishi</reporter>
                        <labels>
                    </labels>
                <created>Mon, 11 Oct 2021 17:10:39 +0000</created>
                <updated>Mon, 1 Nov 2021 22:20:13 +0000</updated>
                            <resolved>Mon, 1 Nov 2021 22:19:48 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="4161999" author="esha.maharishi@10gen.com" created="Mon, 1 Nov 2021 22:19:20 +0000"  >&lt;p&gt;I misread the code originally: read commands will actually &lt;em&gt;never&lt;/em&gt; return TenantMigrationAborted.&lt;/p&gt;

&lt;p&gt;The main reason this was confusing was that TenantMigrationDonorAccessBlocker::getCanReadFuture and TenantMigrationDonorAccessBlocker::checkIfCanWrite return different futures that are set differently if the migration aborts:&lt;/p&gt;

&lt;p&gt;If the migration is blocking reads, TenantMigrationDonorAccessBlocker::getCanReadFuture &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8d6668dd678ca61668d41ceb3d0082290b429562/src/mongo/db/repl/tenant_migration_donor_access_blocker.cpp#L187&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;returns _transitionOutOfBlockingPromise&lt;/a&gt;, which is &lt;b&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/8d6668dd678ca61668d41ceb3d0082290b429562/src/mongo/db/repl/tenant_migration_donor_access_blocker.cpp#L374&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;set with an ok status if the migration aborts&lt;/a&gt;.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;If the migration is blocking writes, TenantMigrationDonorAccessBlocker::checkIfCanWrite &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8d6668dd678ca61668d41ceb3d0082290b429562/src/mongo/db/repl/tenant_migration_donor_access_blocker.cpp#L95&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;throws TenantMigrationConflict&lt;/a&gt;, which is&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/8d6668dd678ca61668d41ceb3d0082290b429562/src/mongo/db/service_entry_point_common.cpp#L772-L776&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;caught in service_entry_point_common.cpp&lt;/a&gt; where it &lt;a href=&quot;https://github.com/mongodb/mongo/blob/8d6668dd678ca61668d41ceb3d0082290b429562/src/mongo/db/repl/tenant_migration_donor_access_blocker.cpp#L111&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;waits for _completionPromise&lt;/a&gt;, which is &lt;b&gt;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/8d6668dd678ca61668d41ceb3d0082290b429562/src/mongo/db/repl/tenant_migration_donor_access_blocker.cpp#L375&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;set with TenantMigrationAborted if the migration aborts&lt;/a&gt;.&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;We are also refactoring the TenantMigrationDonorAccessBlocker::getCanReadFuture function to improve its clarity under &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-61114&quot; title=&quot;Refactor TenantMigrationDonorAccessBlocker::getCanReadFuture to make it easier to understand&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-61114&quot;&gt;&lt;del&gt;SERVER-61114&lt;/del&gt;&lt;/a&gt;.&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>5.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 14 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-2477</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>
                            2 years, 14 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>esha.maharishi@mongodb.com</customfieldvalue>
            <customfieldvalue>mathis.bessa@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i05713:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hzowv3:</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="5514">Server Serverless 2021-10-11</customfieldvalue>
    <customfieldvalue id="5517">Server Serverless 2021-10-18</customfieldvalue>
    <customfieldvalue id="5518">Server Serverless 2021-10-25</customfieldvalue>
    <customfieldvalue id="5546">Server Serverless 2021-11-01</customfieldvalue>
    <customfieldvalue id="5553">Server Serverless 2021-11-15</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|i04t6f:</customfieldvalue>

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