<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:22:29 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-50371] Make a version of TaskExecutor::scheduleRemoteCommand that returns a future</title>
                <link>https://jira.mongodb.org/browse/SERVER-50371</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently, TaskExecutor only&#160;&lt;a href=&quot;https://github.com/mongodb/mongo/blob/0662433ac038f4f3cf137a1be30ca245c180e990/src/mongo/executor/task_executor.h#L274-L281&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;has&lt;/a&gt; a scheduleRemoteCommand interface that takes a callback and returns a callback handle.&lt;/p&gt;

&lt;p&gt;As we are structuring more code as a future chain that runs on an executor with a limited number of threads (particularly Primary-Only Service instances), it will be very helpful to have a version of scheduleRemoteCommand that returns a Future.&lt;/p&gt;

&lt;p&gt;This, combined with the generic whenAll/whenAny/collect utilities described in &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50341&quot; title=&quot;Make generic whenAll, whenAny, collect utilities for futures&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50341&quot;&gt;&lt;del&gt;SERVER-50341&lt;/del&gt;&lt;/a&gt;, would be very useful in writing a Primary-Only Service which has steps that send a command to many remote nodes and wait for all of their responses.&lt;/p&gt;

&lt;p&gt;Note that &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50342&quot; title=&quot;Make version of Shard::runCommand that returns a future&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50342&quot;&gt;SERVER-50342&lt;/a&gt;, which is to add a version of Shard::runCommand that returns a Future, would help in sharding code, but would not help for code that runs in standalone replica sets, such as the Primary-Only Services being built for Multitenant Migrations for Serverless (PM-1791).&lt;/p&gt;

&lt;p&gt;While this is not an immediately blocking work on PM-1791, since we can work around it by blocking the thread on the executor while waiting for a network response, it does block releasing PM-1791.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1445647">SERVER-50371</key>
            <summary>Make a version of TaskExecutor::scheduleRemoteCommand that returns a future</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="3">Duplicate</resolution>
                                        <assignee username="matthew.saltz@mongodb.com">Matthew Saltz</assignee>
                                    <reporter username="esha.maharishi@mongodb.com">Esha Maharishi</reporter>
                        <labels>
                    </labels>
                <created>Tue, 18 Aug 2020 19:13:34 +0000</created>
                <updated>Thu, 1 Oct 2020 21:23:52 +0000</updated>
                            <resolved>Thu, 1 Oct 2020 21:23:52 +0000</resolved>
                                                                    <component>Internal Code</component>
                                        <votes>0</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="3421689" author="matthew.saltz" created="Thu, 1 Oct 2020 21:23:52 +0000"  >&lt;p&gt;Doing this work as part of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50658&quot; title=&quot;Add support for CancelationTokens to TaskExecutor::scheduleRemoteCommand&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50658&quot;&gt;&lt;del&gt;SERVER-50658&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3409661" author="matthew.saltz" created="Thu, 24 Sep 2020 15:37:24 +0000"  >&lt;p&gt;This particular ticket is really only about an API change. Over the past year or so we&apos;ve been gradually transitioning from callback-style async programming to using futures, and this ticket is part of the push to really make the codebase futures-friendly.&lt;/p&gt;</comment>
                            <comment id="3408737" author="JIRAUSER1256988" created="Wed, 23 Sep 2020 23:52:06 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=matthew.saltz&quot; class=&quot;user-hover&quot; rel=&quot;matthew.saltz&quot;&gt;matthew.saltz&lt;/a&gt;, I was looking at this and let me pass on some trivial observations on this bug:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;The std::future interface is clearly missing here but otherwise we should not add more logic to this class, it has enough of responsibilities.&lt;/li&gt;
	&lt;li&gt;What I would like is to make the&#160;scheduleRemoteCommand() to be able to return an immediate failure indicating that the internal queue is full and cannot schedule any more jobs. For this the &apos;&lt;br/&gt;
ThreadPoolTaskExecutor::scheduleIntoPool_inlock()&apos; needs to be refactored from void to Status.&#160;&lt;br/&gt;
&#160;The reason for this is when we move to multi-tenant, there will be a need for proper user isolation. There should be no logic related to user isolation in the&#160;ThreadPoolTaskExecutor for the reason this logic could be quite complex and different depending on a particular task. The only thing the class that is handling user isolation (an AdmissionController if you will) needs to know is that the Executor is full. This will trigger the logic to penalize the most abusive users and make their jobs to be either canceled or penalized. One good way to do that could be a &apos;token bucket&apos; that we can discuss separately. The&#160;ThreadPoolTaskExecutor should not know anything about users and job priorities, it should have a relatively short queue, much shorter than the per-user queues at the AdmissionController.&lt;/li&gt;
&lt;/ol&gt;
</comment>
                            <comment id="3408392" author="matthew.saltz" created="Wed, 23 Sep 2020 20:38:31 +0000"  >&lt;p&gt;Assigning myself to this as it looks like it&apos;ll make sense to fold the work into &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-50658&quot; title=&quot;Add support for CancelationTokens to TaskExecutor::scheduleRemoteCommand&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-50658&quot;&gt;&lt;del&gt;SERVER-50658&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3352473" author="esha.maharishi@10gen.com" created="Fri, 21 Aug 2020 16:05:00 +0000"  >&lt;p&gt;Ah, thanks &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=haley.connelly&quot; class=&quot;user-hover&quot; rel=&quot;haley.connelly&quot;&gt;haley.connelly&lt;/a&gt;, that&apos;s a fairly concise workaround to simulate a Future-returning scheduleRemoteCommand. We can use this pattern to avoid blocking the thread.&lt;/p&gt;

&lt;p&gt;However, I would still advocate for adding a Future-returning scheduleRemoteCommand sooner rather than later since I imagine most of the Primary-Only Services being built right now would benefit from it.&lt;/p&gt;</comment>
                            <comment id="3347896" author="haley.connelly" created="Wed, 19 Aug 2020 19:53:30 +0000"  >&lt;p&gt;May be worth noting,  we essentially do this inside &lt;a href=&quot;https://github.com/mongodb/mongo/blob/45a9e0a76e4a9ef995b3490d74610cab98dbcc0a/src/mongo/db/pipeline/process_interface/replica_set_node_process_interface.cpp#L177-L191&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;StatusWith&amp;lt;BSONObj&amp;gt; ReplicaSetNodeProcessInterface::_executeCommandOnPrimary&lt;/a&gt; and could extract it into its own method.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="1458182">SERVER-50658</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1444487">SERVER-50342</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1444484">SERVER-50341</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>6.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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 19 Aug 2020 19:53:30 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 18 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>esha.maharishi@mongodb.com</customfieldvalue>
            <customfieldvalue>haley.connelly@mongodb.com</customfieldvalue>
            <customfieldvalue>matthew.saltz@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hy0zvj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hxof87:</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="4254">Sharding 2020-10-19</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|hy0m4v:</customfieldvalue>

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