Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sqlalchemy primary key black-out error on DDRQ #27538

Merged
merged 1 commit into from Nov 7, 2022

Conversation

ephraimbuddy
Copy link
Contributor

@ephraimbuddy ephraimbuddy commented Nov 7, 2022

What happened was that the DatasetDagRunQueue(DDRQ) was updated before the change in the consumer dag.
During sync to db, the dataset was marked for deletion from the dag causing the primary key in DDRQ to be nullified which threw an error.
The solution was to add cascade deletion on DagScheduleDatasetReference relation to DDRQ so that when DagScheduleDatasetReference object is marked for deletion the DDRQ object will also be marked

closes: #27509

What happened was that the DatasetDagRunQueue(DDRQ) was updated before the change in the consumer dag.
During sync to db, the dataset was marked for deletion from the dag causing the primary key in DDRQ to be nullified which threw an error.
The solution was to add cascade deletion on DagScheduleDatasetReference relation to DDRQ so that when DagScheduleDatasetReference object is marked for deletion the DDRQ object will also be marked
@uranusjr uranusjr merged commit fc59b02 into apache:main Nov 7, 2022
@uranusjr uranusjr deleted the add-cascade-dagscheduleref branch November 7, 2022 13:03
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Nov 9, 2022
@ephraimbuddy ephraimbuddy added this to the Airflow 2.4.3 milestone Nov 9, 2022
ephraimbuddy added a commit that referenced this pull request Nov 9, 2022
ephraimbuddy added a commit that referenced this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing DAG dataset dependency when it is already ready results in SQLAlchemy cascading delete error
3 participants