Serialize IFR flags in finalizePipelineAndTargetShardsForExplain

XMLWordPrintableJSON

    • Query Integration
    • Fully Compatible
    • ALL
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We serialize IFR flags in finalizeAndMaybePreparePipelineForExecution, but this misses a case where we're running an explain in a single shard cluster where the shard dispatches to itself locally. We also need to serialize IFR flags in finalizePipelineAndTargetShardsForExplain to handle this case.

      This was only failing in the single shard explain case because:
      1. For single node, we don't do any node to node communication, so all IFR flags are preserved.
      2. For sharded collections, when we dispatch from mongos to the shard, we set fromRouter=true here, so in pipeline_command.cpp, we'll manually disable the extension from running at the top of the command invocation on the shard. Notably, fromRouter is false in the shard-local dispatch case.

      Another option would be to centralize IFR flag serialization in dispatchTargetedShardPipeline, which is called from all paths. However, we'd need to thread the AggregateCommandRequest down further to call setIfrFlags(), which would affect other callsites such as ClusterMapReduceCmd.

            Assignee:
            Lynne Wang
            Reporter:
            Lynne Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: