Skip to content

Fix: Preserve BACKFILL run_type and triggering_user_name for repeated backfills#62142

Open
abhijeets25012-tech wants to merge 2 commits intoapache:mainfrom
abhijeets25012-tech:fix/backfill-clean
Open

Fix: Preserve BACKFILL run_type and triggering_user_name for repeated backfills#62142
abhijeets25012-tech wants to merge 2 commits intoapache:mainfrom
abhijeets25012-tech:fix/backfill-clean

Conversation

@abhijeets25012-tech
Copy link
Contributor

What does this PR do?

Fixes an issue where repeated backfill runs for the same logical date
could result in incorrect DagRun metadata due to IntegrityError handling
that skipped updating existing DagRuns.

Root Cause

When a DagRun already existed for a logical_date, backfill logic skipped
creation without ensuring the run_type and triggering_user_name remained
consistent with BACKFILL semantics.

Fix

When IntegrityError occurs:

  • Fetch the existing DagRun
  • Ensure run_type is set to BACKFILL_JOB
  • Preserve triggering_user_name
  • Link BackfillDagRun correctly

Additional Notes

No new dependencies are introduced. This ensures consistent metadata
for all backfill runs, first or subsequent.

Closes: #62126

@Srabasti
Copy link
Contributor

Looks like static checks are failing. Please run prek locally before committing changes.

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.

Dag Run ID and Triggering User Name are not recorded properly for a Backfill job

3 participants

Comments