-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DSIP-22][TriggerPlugin] Introduce Trigger Plugin #15330
Comments
Good idea, we may need to design the |
Now architecture quartz scheduler uses db as Pessimistic Concurrency Control, Deep dive if we can leverage quartz interface or we needs to implement ourselves in |
We have table
|
Thanks wenjun for continuous guidance in this thread and very solid architecture design in dolphinscheduler! These days I've been thinking the relationship of trigger & scheduler service responsibility in new architecture.
Pull mode is more common and needs resource, I am thinking integrate pull trigger into a special task type, which could be dispatched by master/worker, leverage current task architecture which can master/server failover. Scheduler: pull trigger instance on this master host -> command
As you mentioned, I've trying to design triggerAPI in code level. now I am learning previous task/registry/scheduler design & code pattern.
I got your point from your scheduler api refactor, but it may be hard to do mult steps. In first stage maybe we can extends quartz scheduler in current architecture design. For long-term fix I may think the relationship & boundary between |
My current design is as below:
|
We need to define how to assign the trigger to Master, since we use |
Thanks for Wenjun's support. Here's current quartz architecture. DolphinScheduler uses quartz scheduled by timer trigger and insert command into DB. For quartz scheduler, it use exclusive lock while acquiring Triggers and fired them to get JobDetails for executing in hosted threadpool. Actually it use DB as distributed lock solution. Currently quartz not share public interface for us for implementation our own trigger mechanism. Here's the high-level steps we implement this feature:
I am still considering a better solution that we can compatible with quart scheduler in first version, but it seems a bit hard. |
Here's the question, One solution is we add one more table to record offset for fetching, once master is alive, every time master will firstly acquire lock, then fetching for more gracefully, we can do it in consistent-hash way. just like memcached & brpc. https://github.com/apache/brpc/blob/master/src/brpc/policy/dynpart_load_balancer.cpp#L83consider to its complexity, I will use method #1 for implementation. |
@ruanwenjun Can you help guide this design? |
Search before asking
Description
After seeing all local & large distributed job-scheduling framework,
I found that we may leverage our excellent plugin framwork design and consider extending a key process in job-scheduling ---- Trigger, which allows user to defines their custom trigger in distributed runtime environment.
Apparently quartz has considered this situation, which is a part of master scheduler, but not extend into distributed executing semantics.
seeing https://www.quartz-scheduler.org/documentation/quartz-2.1.7/tutorials/tutorial-lesson-04.html
In distributed job-scheduling environment, we could aligned all trigger into a event trigger.
Use case
This is common case. which is currently widely supported by dophinscheduler and all other job-scheduling framework, which event is signal event from timer.
for example, after receive a message with some pattern, we should start a new workflow. which event is message from MQ.
very popular. after we make a HTTP call with dophinscheduler-api, we should start a new workflow. even we can trigger pipeline after we receive an email from external 3p team.
which event is network call.
In common scenarios, we often use streaming to do some near-real-time OLAP job, which requires batch job for backfill supplyment in case some unexpected error happens in streaming.
which event could be any condition with streaming elements.
Benefits from the best plugin in dolphinscheduler.
We should consider to add trigger SPI plugin loaded by master server.
Overview:
Detail Design
Controller Layer
Compatibility
DB Layer
t_ds_trigger
t_ds_schedules
Related issues
[DSIP-16][Task] Support stream task
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: