dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

Worker grouping, queue consumption problem(worker 分组, 队列消费问题)

Open hujiang75277381 opened this issue 7 years ago • 4 comments

Worker A (can only handle A-type tasks), worker B (can only handle B-type tasks), there are three types of A B C tasks in the queue, you need to skip C to consume B and A.


worker A(只能处理A类型的任务),worker B(只能处理B类型的任务),此时 队列中存在 A B C 三个类型的任务,需要跳过C 去消费 B 和A

hujiang75277381 avatar May 24 '19 09:05 hujiang75277381

good idea, we will improve it later! thx!

davidzollo avatar May 24 '19 09:05 davidzollo

I handled this problem in my own way.

  1. Add the type of task in processDao.taskZkInfo (line 954) to form    Task type_process instance priority_process instance id_task priority_task id.

  2. In taskQueueZkImpl.poll (line 141), determine that the current worker can handle those task types, and discard if not supported. Remove the task type taskId and make a priority comparison.


我通过我自己的方式,把这个问题处理了。 1.在processDao.taskZkInfo(954行) 中添加task的类型,形成 task类型_流程实例优先级_流程实例id_任务优先级_任务id 。

2.在taskQueueZkImpl.poll(141行) ,判断当前worker能处理那些task类型,如果不支持就丢弃。 把 task类型 taskId 中去掉,做优先级比较。

hujiang75277381 avatar May 25 '19 03:05 hujiang75277381

we handle it by "${processInstancePriority}${processInstanceId}${taskInstancePriority}_${taskId}_host1,host2,...", add task can execute on hosts at the end

davidzollo avatar Jun 26 '19 12:06 davidzollo

when execute method "taskQueueZkImpl.poll",worker server will hold its ip to match, if can match ,the task will be taken

davidzollo avatar Jun 26 '19 12:06 davidzollo