YongGang commented on code in PR #16041:
URL: https://github.com/apache/druid/pull/16041#discussion_r1556171737


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:
##########
@@ -697,6 +702,11 @@ private QueryDefinition initializeQueryDefAndState(final 
Closer closer)
         MSQControllerTask.isReplaceInputDataSourceTask(task)
     );
 
+    // propagate the controller's context and tags to the worker task
+    taskContextOverridesBuilder.put(MultiStageQueryContext.CTX_OF_CONTROLLER, 
task.getContext());

Review Comment:
   In the Task/SubTask scenario, for non-MSQ task, the subtask share the 
[parent task 
context](https://github.com/apache/druid/blob/28.0.0/indexing-service/src/main/java/org/apache/druid/indexing/common/task/CompactionTask.java#L551).
   For MSQ task, we don't have this logic but need something similar due to:
   1. the `tags` are generated based on `Task.spec`, only Controller task has 
all the needed info. So Controller and Worker task share the same tags for 
monitoring purpose.
   2. There are valuable info Worker task need to know from Controller task 
(e.g. the `labels` field in the future). So here Controller's context are 
passed in to the Worker as a reference field. The Worker task itself couldn't 
generate these context fields without knowing the Controller's setting.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to