Skip to content

Fix only_new clear for Dag runs without a created version - #75600

Open
LiaoAB wants to merge 2 commits into
apache:mainfrom
LiaoAB:fix/only-new-versionless-run
Open

LiaoAB wants to merge 2 commits into
apache:mainfrom
LiaoAB:fix/only-new-versionless-run

Conversation

@LiaoAB

@LiaoAB LiaoAB commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

only_new clear relied on created_dag_version_id to decide which tasks were new. Runs without that pointer (migrated from Airflow 2, or after db clean) were treated as having no new tasks. Use the run's existing TaskInstance rows instead.

closes: #71455
related: #71453

Testing

  • Added a regression test for a versionless DagRun.
  • test_cleartasks.py: 119 passed, 1 skipped.
  • ruff format/check pass.

Was generative AI tooling used to co-author this PR?
  • Yes — opencode was used for assistance; the author reviewed and validated the final changes.

Generated-by: opencode following the guidelines. The author reviewed and tested the changes.

@LiaoAB
LiaoAB requested review from XD-DENG and ashb as code owners October 25, 2026 07:16
Dag runs carried over from Airflow 2, or whose Dag version was removed by
db clean, have no created version. only_new diffed the latest Dag against
that pointer, so it reported no new tasks and silently skipped tasks added
since the run was created.
A temporary network failure while querying provider metadata should not abort the entire constraints generation job when the request can succeed on a subsequent attempt.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

only_new clear can silently miss real new tasks after a prior "run on latest version" clear

1 participant