Skip to content

Store executor callback DagRun references in the database - #71214

Open
fat-catTW wants to merge 1 commit into
apache:mainfrom
fat-catTW:callback-dagrun-fkey
Open

Store executor callback DagRun references in the database#71214
fat-catTW wants to merge 1 commit into
apache:mainfrom
fat-catTW:callback-dagrun-fkey

Conversation

@fat-catTW

Copy link
Copy Markdown
Contributor

Why

Executor callbacks need to know which DagRun they belong to when the scheduler
builds callback workloads. Keeping that reference only in callback.data makes
the scheduler depend on payload shape instead of a database-managed relationship.

Solution

Add a nullable callback.dagrun_id foreign key to dag_run.id and have executor
callbacks store their DagRun reference there. The scheduler now loads the
relationship through the ORM when enqueueing callback workloads.

The migration backfills existing rows from deadline relationships first, then
falls back to legacy callback payload data when needed.

Was generative AI tooling used to co-author this PR?
  • [X] Yes (please specify the tool below)

Generated-by: [Codex] following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborg boring-cyborg Bot added area:db-migrations PRs with DB migration area:deadline-alerts AIP-86 (former AIP-57) area:Scheduler including HA (high availability) scheduler kind:documentation labels Aug 6, 2026
@fat-catTW
fat-catTW force-pushed the callback-dagrun-fkey branch 2 times, most recently from 40f7be8 to 26897c6 Compare August 9, 2026 15:00
Comment thread airflow-core/src/airflow/jobs/scheduler_job_runner.py
@fat-catTW
fat-catTW force-pushed the callback-dagrun-fkey branch 2 times, most recently from 0f18798 to 783542a Compare August 11, 2026 03:37
@fat-catTW
fat-catTW force-pushed the callback-dagrun-fkey branch from 783542a to cd2ebfe Compare August 19, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:db-migrations PRs with DB migration area:deadline-alerts AIP-86 (former AIP-57) area:Scheduler including HA (high availability) scheduler kind:documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants