[jira] [Commented] (AIRFLOW-3543) rescheduled tasks block DAG deletion
[ https://issues.apache.org/jira/browse/AIRFLOW-3543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16797671#comment-16797671 ] ASF subversion and git services commented on AIRFLOW-3543: -- Commit 1e8ab63ffd03612c282b793cc740591cd8aeefd7 in airflow's branch refs/heads/v1-10-stable from Stefan Seelmann [ https://gitbox.apache.org/repos/asf?p=airflow.git;h=1e8ab63 ] AIRFLOW-3543: Fix deletion of DAG with rescheduled tasks (#4646) > rescheduled tasks block DAG deletion > > > Key: AIRFLOW-3543 > URL: https://issues.apache.org/jira/browse/AIRFLOW-3543 > Project: Apache Airflow > Issue Type: Bug > Components: cli, database > Environment: postgres 10 database >Reporter: Christopher >Assignee: Stefan Seelmann >Priority: Critical > Fix For: 1.10.3 > > > This applies to current master branch after > [AIRFLOW-2747|https://github.com/apache/incubator-airflow/commit/dc59d7e2750aa90e099afad8689f2646f18f92a6] > was merged. > Once a sensor task is rescheduled, the task cannot be deleted from the DB due > to a foreign key constraint. This prevents deletion of tasks and DAGS. This > occurs regardless of whether the DAG is still running or whether the sensor > is actually rescheduled to run in the future or not (ie the task may complete > successfully but its entry still resides as a row in the task_reschedule > table. > > I am running a postgres-backed airflow instance. > > {{Traceback (most recent call last):}} > {{ File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", > line 1193, in _execute_context}} > {{context) > {{File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", > line 509, in do_execute > {{cursor.execute(statement, parameters)}} > {{psycopg2.IntegrityError: update or delete on table "task_instance" violates > foreign key constraint "task_reschedule_dag_task_date_fkey" on table > "task_reschedule"}} > {{DETAIL: Key (task_id, dag_id, execution_date)=(check_images_ready_11504, > flight5105_v0.0.1, 2018-12-13 00:00:00+00) is still referenced from table > "task_reschedule".}} > {{sqlalchemy.exc.IntegrityError: (psycopg2.IntegrityError) update or delete > on table "task_instance" violates foreign key constraint > "task_reschedule_dag_task_date_fkey" on table "task_reschedule"}} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRFLOW-3543) rescheduled tasks block DAG deletion
[ https://issues.apache.org/jira/browse/AIRFLOW-3543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16779403#comment-16779403 ] ASF GitHub Bot commented on AIRFLOW-3543: - Fokko commented on pull request #4646: AIRFLOW-3543: Fix deletion of DAG with rescheduled tasks URL: https://github.com/apache/airflow/pull/4646 This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > rescheduled tasks block DAG deletion > > > Key: AIRFLOW-3543 > URL: https://issues.apache.org/jira/browse/AIRFLOW-3543 > Project: Apache Airflow > Issue Type: Bug > Components: cli, database > Environment: postgres 10 database >Reporter: Christopher >Assignee: Stefan Seelmann >Priority: Critical > > This applies to current master branch after > [AIRFLOW-2747|https://github.com/apache/incubator-airflow/commit/dc59d7e2750aa90e099afad8689f2646f18f92a6] > was merged. > Once a sensor task is rescheduled, the task cannot be deleted from the DB due > to a foreign key constraint. This prevents deletion of tasks and DAGS. This > occurs regardless of whether the DAG is still running or whether the sensor > is actually rescheduled to run in the future or not (ie the task may complete > successfully but its entry still resides as a row in the task_reschedule > table. > > I am running a postgres-backed airflow instance. > > {{Traceback (most recent call last):}} > {{ File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", > line 1193, in _execute_context}} > {{context) > {{File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", > line 509, in do_execute > {{cursor.execute(statement, parameters)}} > {{psycopg2.IntegrityError: update or delete on table "task_instance" violates > foreign key constraint "task_reschedule_dag_task_date_fkey" on table > "task_reschedule"}} > {{DETAIL: Key (task_id, dag_id, execution_date)=(check_images_ready_11504, > flight5105_v0.0.1, 2018-12-13 00:00:00+00) is still referenced from table > "task_reschedule".}} > {{sqlalchemy.exc.IntegrityError: (psycopg2.IntegrityError) update or delete > on table "task_instance" violates foreign key constraint > "task_reschedule_dag_task_date_fkey" on table "task_reschedule"}} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRFLOW-3543) rescheduled tasks block DAG deletion
[ https://issues.apache.org/jira/browse/AIRFLOW-3543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16779404#comment-16779404 ] ASF subversion and git services commented on AIRFLOW-3543: -- Commit 078ff765dbde1a47a0f9bcbd605c711e96201f79 in airflow's branch refs/heads/master from Stefan Seelmann [ https://gitbox.apache.org/repos/asf?p=airflow.git;h=078ff76 ] AIRFLOW-3543: Fix deletion of DAG with rescheduled tasks (#4646) > rescheduled tasks block DAG deletion > > > Key: AIRFLOW-3543 > URL: https://issues.apache.org/jira/browse/AIRFLOW-3543 > Project: Apache Airflow > Issue Type: Bug > Components: cli, database > Environment: postgres 10 database >Reporter: Christopher >Assignee: Stefan Seelmann >Priority: Critical > > This applies to current master branch after > [AIRFLOW-2747|https://github.com/apache/incubator-airflow/commit/dc59d7e2750aa90e099afad8689f2646f18f92a6] > was merged. > Once a sensor task is rescheduled, the task cannot be deleted from the DB due > to a foreign key constraint. This prevents deletion of tasks and DAGS. This > occurs regardless of whether the DAG is still running or whether the sensor > is actually rescheduled to run in the future or not (ie the task may complete > successfully but its entry still resides as a row in the task_reschedule > table. > > I am running a postgres-backed airflow instance. > > {{Traceback (most recent call last):}} > {{ File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", > line 1193, in _execute_context}} > {{context) > {{File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", > line 509, in do_execute > {{cursor.execute(statement, parameters)}} > {{psycopg2.IntegrityError: update or delete on table "task_instance" violates > foreign key constraint "task_reschedule_dag_task_date_fkey" on table > "task_reschedule"}} > {{DETAIL: Key (task_id, dag_id, execution_date)=(check_images_ready_11504, > flight5105_v0.0.1, 2018-12-13 00:00:00+00) is still referenced from table > "task_reschedule".}} > {{sqlalchemy.exc.IntegrityError: (psycopg2.IntegrityError) update or delete > on table "task_instance" violates foreign key constraint > "task_reschedule_dag_task_date_fkey" on table "task_reschedule"}} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRFLOW-3543) rescheduled tasks block DAG deletion
[ https://issues.apache.org/jira/browse/AIRFLOW-3543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16759469#comment-16759469 ] ASF GitHub Bot commented on AIRFLOW-3543: - seelmann commented on pull request #4646: AIRFLOW-3543: Fix deletion of DAG with rescheduled tasks URL: https://github.com/apache/airflow/pull/4646 Make sure you have checked _all_ steps below. ### Jira - [X] My PR addresses the following [Airflow Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references them in the PR title. - https://issues.apache.org/jira/browse/AIRFLOW-3543 ### Description - [X] Here are some details about my PR, including screenshots of any UI changes: - `TaskReschedule` must be deleted before `TaskInstance` because of foreign key constraint ### Tests - [X] My PR extends the following unit tests - `test_delete_dag.py` - Also changed tests to use `with create_session() as session` ### Commits - [X] My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)": 1. Subject is separated from body by a blank line 1. Subject is limited to 50 characters (not including Jira issue reference) 1. Subject does not end with a period 1. Subject uses the imperative mood ("add", not "adding") 1. Body wraps at 72 characters 1. Body explains "what" and "why", not "how" ### Documentation - [ ] In case of new functionality, my PR adds documentation that describes how to use it. - When adding new operators/hooks/sensors, the autoclass documentation generation needs to be added. - All the public functions and the classes in the PR contain docstrings that explain what it does ### Code Quality - [X] Passes `flake8` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > rescheduled tasks block DAG deletion > > > Key: AIRFLOW-3543 > URL: https://issues.apache.org/jira/browse/AIRFLOW-3543 > Project: Apache Airflow > Issue Type: Bug > Components: cli, database > Environment: postgres 10 database >Reporter: Christopher >Assignee: Stefan Seelmann >Priority: Critical > > This applies to current master branch after > [AIRFLOW-2747|https://github.com/apache/incubator-airflow/commit/dc59d7e2750aa90e099afad8689f2646f18f92a6] > was merged. > Once a sensor task is rescheduled, the task cannot be deleted from the DB due > to a foreign key constraint. This prevents deletion of tasks and DAGS. This > occurs regardless of whether the DAG is still running or whether the sensor > is actually rescheduled to run in the future or not (ie the task may complete > successfully but its entry still resides as a row in the task_reschedule > table. > > I am running a postgres-backed airflow instance. > > {{Traceback (most recent call last):}} > {{ File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", > line 1193, in _execute_context}} > {{context) > {{File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", > line 509, in do_execute > {{cursor.execute(statement, parameters)}} > {{psycopg2.IntegrityError: update or delete on table "task_instance" violates > foreign key constraint "task_reschedule_dag_task_date_fkey" on table > "task_reschedule"}} > {{DETAIL: Key (task_id, dag_id, execution_date)=(check_images_ready_11504, > flight5105_v0.0.1, 2018-12-13 00:00:00+00) is still referenced from table > "task_reschedule".}} > {{sqlalchemy.exc.IntegrityError: (psycopg2.IntegrityError) update or delete > on table "task_instance" violates foreign key constraint > "task_reschedule_dag_task_date_fkey" on table "task_reschedule"}} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)