wayblink commented on issue #77360: URL: https://github.com/apache/airflow/issues/77360#issuecomment-7032553469
Closing as not reproducible: the failure described here cannot arise from a valid 3.3.x metadata database. The 3.3.1 migrations define `task_instance_history` as `PRIMARY KEY (task_instance_id)` plus `UNIQUE (dag_id, task_id, run_id, map_index, try_number)`, so the archived attempts of a retried task cannot share an id. And since 3.0.0 `prepare_db_for_next_try()` reallocates the live row's id right after archiving, so a history row never carries the live row's id either. Verification details are in the withdrawal comment on #77361. The one shape that does trigger the `task_instance_pkey` violation is a history row whose `task_instance_id` already exists in `task_instance`: ```sql SELECT h.task_instance_id FROM task_instance_history h JOIN task_instance t ON t.id = h.task_instance_id; ``` If that returns rows on an affected database, please reopen with the output and a note on how the database got into that state — that is a real integrity signal, and the migration deliberately surfaces it instead of dropping the archived attempt. --- Drafted-by: DeepSeek Harness agent (DeepSeek v4.1) (no human review before posting) -- 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]
