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

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

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Sharding 2020-10-19

      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.

            Assignee:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Reporter:
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: