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

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   There is a dependent task instance running. At this time, fault-tolerant 
execution is performed. At this time, there is a function 
`MasterRegistryClient.checkTaskAfterWorkerStart` that needs to determine 
whether the task instance is started after the worker node. The result is 
wrong, resulting in the fault-tolerant execution of the task.
   
   code in 
`org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient`
   ```java
       private Date getServerStartupTime(List<Server> servers, String host) {
           if (CollectionUtils.isEmpty(servers)) {
               return null;
           }
           Date serverStartupTime = null;
           for (Server server : servers) {
               logger.error("host: {}, server host: {}", host, server.getHost() 
+ Constants.COLON + server.getPort());
               if (host.equals(server.getHost() + Constants.COLON + 
server.getPort())) {
                   serverStartupTime = server.getCreateTime();
                   break;
               }
           }
           return serverStartupTime;
       }
   ```
   this is log
   ```log
   [ERROR] 2022-10-21 15:49:37.219 
org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[338] - 
host: 10.66.76.129:5678, server host: 10.66.76.129:1234
   ```
   
   ### What you expected to happen
   
   This dependent task instance should not be fault tolerant
   
   ### How to reproduce
   
   Add a dependent node to depend on an unexecuted process. After waiting for 
the fault-tolerant thread to execute, you can see that the dependent node 
instance is fault-tolerant
   
   ```
   
   [INFO] 2022-10-21 05:00:55.308 
org.apache.dolphinscheduler.server.master.runner.FailoverExecuteThread:[68] - 
failover execute started
   [INFO] 2022-10-21 05:00:55.314 
org.apache.dolphinscheduler.server.master.runner.FailoverExecuteThread:[74] - 
need failover hosts:[192.168.191.2:5678]
   [INFO] 2022-10-21 05:00:55.340 
org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[424] - 
start master[192.168.191.2:5678] failover, process list size:3
   [INFO] 2022-10-21 05:00:55.346 
org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[442] - 
failover task instance id: 8758, process instance id: 6178
   [INFO] 2022-10-21 05:00:55.375 
org.apache.dolphinscheduler.server.master.registry.MasterRegistryClient:[456] - 
master[192.168.191.2:5678] failover end, useTime:48ms
   [INFO] 2022-10-21 05:00:56.007 
org.apache.dolphinscheduler.server.master.runner.EventExecuteService:[127] - 
handle process instance : 6178 , events count:1
   [INFO] 2022-10-21 05:00:56.007 
org.apache.dolphinscheduler.server.master.runner.EventExecuteService:[130] - 
already exists handler process size:0
   [INFO] 2022-10-21 05:00:56.008 
org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[308] - 
process event: State Event :key: null type: TASK_STATE_CHANGE executeStatus: 
NEED_FAULT_TOLERANCE task instance id: 8758 process instance id: 6178 context: 
null
   [INFO] 2022-10-21 05:00:56.010 
org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[422] - 
work flow 6178 task 8758 state:NEED_FAULT_TOLERANCE 
   [INFO] 2022-10-21 05:00:56.010 
org.apache.dolphinscheduler.server.master.runner.WorkflowExecuteThread:[424] - 
resubmit NEED_FAULT_TOLERANCE dependent task
   ```
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   2.0.x
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### 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