Skip to content

[Bug] [DependentExecute] Result calculation of task-instance should ignore need-fault-tolerance state #17353

@reele

Description

@reele

Search before asking

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

What happened

now DependentExecute use findLastTaskInstance to find task-instances in workflow-instance:

<select id="findLastTaskInstance" resultType="org.apache.dolphinscheduler.dao.entity.TaskInstance">
select
<include refid="baseSql"/>
from t_ds_task_instance
where workflow_instance_id = #{workflowInstanceId}
and task_code = #{taskCode}
order by end_time desc limit 1
</select>

when a workflow has been failover, the unfinished old task-instance's state will set into NEED_FAULT_TOLERANCE(8) and then never handle it, but it will affect the query result above, some database is null first default, so even if the new task-instance is finished, the dependent task will still stuck in old task-instance's state.

Image

What you expected to happen

ignore failovered task-instance in dependent handling.

How to reproduce

Anything else

No response

Version

dev

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

backendbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions