Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-50371

Make a version of TaskExecutor::scheduleRemoteCommand that returns a future

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Sprint:
      Sharding 2020-10-19

      Description

      Currently, TaskExecutor only has a scheduleRemoteCommand interface that takes a callback and returns a callback handle.

      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.

      This, combined with the generic whenAll/whenAny/collect utilities described in SERVER-50341, 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.

      Note that SERVER-50342, 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).

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              matthew.saltz Matthew Saltz
              Reporter:
              esha.maharishi Esha Maharishi
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: