ruanwenjun opened a new issue, #15897:
URL: https://github.com/apache/dolphinscheduler/issues/15897

   ### Search before asking
   
   - [X] I had searched in the 
[DSIP](https://github.com/apache/dolphinscheduler/issues/14102) 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.
   
   <img width="1074" alt="image" 
src="https://github.com/apache/dolphinscheduler/assets/22415594/7d36905e-6537-4148-8509-2c4ca265bde4";>
   
   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.
   
   <img width="1067" alt="image" 
src="https://github.com/apache/dolphinscheduler/assets/22415594/c9362d75-a0c4-4534-824e-2f2b970f88e1";>
   
   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.
   
   ```yaml
   command:
       fetch: 
           strategy: 
               type: BY_ID
               step: 2
   ```
   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
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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]

Reply via email to