apache / dolphinscheduler

Apache DolphinScheduler is the modern data orchestration platform. Agile to create high performance workflow with low-code

Home Page:https://dolphinscheduler.apache.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[DSIP-32][Master] Add command fetcher strategy for master fetch command

ruanwenjun opened this issue · comments

Search before asking

  • I had searched in the DSIP and found no similar DSIP.

Motivation

After 2.0, DS will pre-assign the command into master slot. If the master's currentSlotIndex = id % slotSize, then the command will be assign to the master.

image

This can work well then the command id is auto increment with step 1, but in some scenarios, the step is not 1, e.g. in distributed table, the step might be table size.
If the t_ds_command is exist in two database, and we want to make sure the id will not conflict, we might set the step be 2.

Then the id in one database will be 1,3,5,7,9. the commands will always assign to master-01.

image

Then the cluster will have single-point problems.

Design Detail

We need to import a CommandFetcher to fetch command. In this case, we will use BY_ID strategy can set the step to 2.

  command-fetch-strategy:
    type: ID_SLOT_BASED
    config:
      # The incremental id step
      id-step: 1
      # master fetch command num
      fetch-size: 10

the commands which (id / step) % slotSize = currentSlotIndex will be fetched by the CommandFetcher.

Compatibility, Deprecation, and Migration Plan

Compatibility with latest version

Test Plan

Test by UT and E2E

Code of Conduct