Skip to content

Conversation

@sunank200
Copy link
Collaborator

@sunank200 sunank200 commented Feb 12, 2024

This PR introduces optimizations to the dags_needing_dagruns method in the DagModel class. The changes include the implementation of batch processing to efficiently handle large sets of DAG IDs. The motivation behind this change is to address the performance issues associated with processing a large number of DAGs, which can lead to significant memory usage and slow down the scheduler.

Changes:

  • Batch Processing: The method now processes DatasetDagRunQueue records in batches, reducing memory usage and improving efficiency. This approach minimizes the overhead of loading and processing large numbers of DAGs simultaneously.
  • Error Handling: Improved the handling of cases where DAG serialization versions are outdated or when no dataset trigger records are found for a given DAG.

Depends on the merge of PR #37016. and #37101

Dependency Checklist


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@sunank200 sunank200 changed the title Optimize dags_needing_dagruns Method with Batch Processin Optimize dags_needing_dagruns Method with Batch Processing Feb 12, 2024
@sunank200 sunank200 force-pushed the optimize-dataset-conditional-logic branch 2 times, most recently from 4998644 to cbc252f Compare February 14, 2024 05:52
@sunank200 sunank200 force-pushed the optimize-dataset-conditional-logic branch from cbc252f to 2f9f77f Compare February 26, 2024 13:23
@sunank200
Copy link
Collaborator Author

Closing this as I have created a new PR

@sunank200 sunank200 closed this Feb 26, 2024
@sunank200 sunank200 deleted the optimize-dataset-conditional-logic branch May 8, 2025 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants