sequentially issue each mongod the search index command

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      currently we use AsyncMulticaster to multicast the search index command on all hosts. The  AsyncMulticaster is intended to send out commands without providing a mechanism for waiting on their responses. This means we can't block the main thread from continuing to execute before the search index commands have finished on all mongods/mongots.

       

      To be able to block, we need to instead loop over all of the hosts and one by one scheduleRemoteCommand where the command is the userCmd (create/drop/update searchindex command) wrapped in a _shardsvrRunSearchIndexCommand. 

      something like this:

                  executor::RemoteCommandResponse response(
                      host, Status(ErrorCodes::InternalError, "Internal error running command"));
      
                  auto callbackHandle = uassertStatusOK(executor->scheduleRemoteCommand(
                      request,
                      [&response](const executor::TaskExecutor::RemoteCommandCallbackArgs& args) {
                          response = args.response;
                      }));
      
                  // Block until the command is carried out
                  executor->wait(callbackHandle); 

            Assignee:
            Unassigned
            Reporter:
            Maddie Zechar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: