You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/02/19 21:03:53 UTC

[GitHub] [airflow] hussein-awala commented on issue #29582: Cannot trigger the same dag_id within the same second

hussein-awala commented on issue #29582:
URL: https://github.com/apache/airflow/issues/29582#issuecomment-1436093181

   > Cannot trigger the same dag_id within the same second
   
   You cannot trigger the dag multiple time with the same execution date because there are two unique constraint on the table:
   - ("dag_id", "execution_date")
   - ("dag_id", "run_id")
   
   > It should be allowed to run the same dag many times without any issue of how fast it is being run. The error message above seems to suggest that there is a unique key constraint with columns:
   dag_id, execution_date
   which prevent this since the execution_date only has resolution to the second. I would have thought dag_id and run_id should be the unique key constraint and leave it up to the caller to guarantee unique run_ids.
   
   The execution_date is a timestamp with precision 6 (6 fractional digits in the seconds field), so it's almost impossible to get the same execution_date if you do 2 sequence trigger queries, unless if there is a problem in the API which you use to create the dag runs.
   
   Can you precise how do you create these dag runs? Which one of Airflow apis (UI, CLI, REST API, Python API) are you using?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org