Fix DagRun execution order from queued to running not being properly followed by ephraimbuddy · Pull Request #18061 · apache/airflow

@ephraimbuddy ephraimbuddy changed the title Fix DagRun execution order not being properly followed Fix DagRun execution order from queued to running not being properly followed

Sep 7, 2021

ashb

ashb

ashb

kaxil

kaxil

This was referenced

Sep 8, 2021
We made a fix that resolved max_active_runs not allowing other dagruns to move to
running state, see apache#17945 and introduced a bug that dagruns were not following the
execution_date order when moving to running state.

This PR fixes it by adding a 'max_active_runs` column in dagmodel. Also an extra test
not connected with this change was added because I was able to trigger the bug while
working on this

fixup! Fix DagRun execution order not being properly followed

fixup! fixup! Fix DagRun execution order not being properly followed

fixup! Fix DagRun execution order not being properly followed

fixup! fixup! Fix DagRun execution order not being properly followed

fixup! Fix DagRun execution order not being properly followed

Use subquery as mysql 5.7 doesn't support cte

fix doc error

Apply suggestions from code review

@ephraimbuddy

ashb

ashb approved these changes Sep 9, 2021

kaxil pushed a commit that referenced this pull request

Sep 10, 2021
…followed (#18061)

We made a fix that resolved max_active_runs not allowing other dagruns to move to
running state, see #17945 and introduced a bug that dagruns were not following the
execution_date order when moving to running state.

This PR fixes it by adding a 'max_active_runs` column in dagmodel. Also an extra test
not connected with this change was added because I was able to trigger the bug while
working on this

(cherry picked from commit ebbe2b4)