shahar1 opened a new pull request, #77157:
URL: https://github.com/apache/airflow/pull/77157

   A partition of a partitioned Dag can have several Dag runs. Clearing a 
finished run requeues it and resets its `start_date`. The backfill lookup for 
the latest run of a partition sorted runs without a `start_date` last, so it 
returned an older finished run instead of the requeued one. With 
`--reprocess-behavior completed` (or `failed`, when the older run failed), the 
backfill then created another run for the partition while one was already 
queued, instead of recording it as `in flight`.
   
   The lookup now falls back to `queued_at` when a run has no `start_date`, so 
the requeued run is the latest one. The documented rule is unchanged: the 
latest run decides, and a backfill does not create a run while that one is 
queued or running.
   
   Non-partitioned Dags are not affected, because they have at most one run per 
logical date.
   
   Tested with a new regression test that fails without the change (SQLite). 
The PostgreSQL and MySQL runs are left to CI.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Fable 5.2)
   
   Generated-by: Claude Code (Fable 5.2) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to