ramziash commented on code in PR #74583:
URL: https://github.com/apache/airflow/pull/74583#discussion_r4693128746


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -2695,6 +2695,45 @@ def _create_dagruns_for_partitioned_asset_dags(self, 
session: Session) -> set[st
                     dag_id=apdr.target_dag_id,
                     carried_partition_date=apdr.partition_date,
                 )
+            # Refire Semantics A ("rerun"): clear + re-queue the existing 
DagRun for this
+            # (dag, partition_key) instead of creating a new one, so a 
late/corrected
+            # event reprocesses in the same DagRun (attempts increment).
+            if getattr(timetable, "refire_policy", None) == "rerun":
+                existing_run = session.scalar(

Review Comment:
   Yes, a manual run on the same key could get cleared. It now follows the APDR 
chain: the latest earlier APDR for the same (target_dag_id, partition_key) that 
has a created_dag_run_id, and uses that run. If the run is gone it just creates 
a new one. The rerun test adds a manual run on the same key and checks its 
clear_number stays 0.
   
   



-- 
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