This is an automated email from the ASF dual-hosted git repository.

kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new ae0b18f  [DS-6638][MasterServer] fix task state no change when 
failover worker (#6639)
ae0b18f is described below

commit ae0b18f3a3284357f7533c015086cd65f27caca5
Author: wind <[email protected]>
AuthorDate: Sun Oct 31 21:12:55 2021 +0800

    [DS-6638][MasterServer] fix task state no change when failover worker 
(#6639)
    
    Co-authored-by: caishunfeng <[email protected]>
---
 .../dolphinscheduler/server/master/registry/MasterRegistryClient.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
 
b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
index 8b5aca0..7ef9432 100644
--- 
a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
+++ 
b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/registry/MasterRegistryClient.java
@@ -275,6 +275,7 @@ public class MasterRegistryClient {
      *
      * @param workerHost worker host
      * @param needCheckWorkerAlive need check worker alive
+     * @param checkOwner need check process instance owner
      */
     private void failoverWorker(String workerHost, boolean 
needCheckWorkerAlive, boolean checkOwner) {
         logger.info("start worker[{}] failover ...", workerHost);
@@ -289,9 +290,8 @@ public class MasterRegistryClient {
             ProcessInstance processInstance = 
processService.findProcessInstanceDetailById(taskInstance.getProcessInstanceId());
             if (workerHost == null
                     || !checkOwner
-                    || processInstance.getHost().equalsIgnoreCase(workerHost)) 
{
+                    || 
processInstance.getHost().equalsIgnoreCase(getLocalAddress())) {
                 // only failover the task owned myself if worker down.
-                // failover master need handle worker at the same time
                 if (processInstance == null) {
                     logger.error("failover error, the process {} of task {} do 
not exists.",
                             taskInstance.getProcessInstanceId(), 
taskInstance.getId());

Reply via email to