You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/12/05 01:17:18 UTC

[airflow] branch main updated: Order TIs by map_index (#27904)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 820c5bbad9 Order TIs by map_index (#27904)
820c5bbad9 is described below

commit 820c5bbad9e3fb2c6eb19a51eafc800267746eae
Author: Tanel Kiis <ta...@users.noreply.github.com>
AuthorDate: Mon Dec 5 03:17:09 2022 +0200

    Order TIs by map_index (#27904)
---
 airflow/jobs/scheduler_job.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/jobs/scheduler_job.py b/airflow/jobs/scheduler_job.py
index 64bc9008f5..6fe8d3d710 100644
--- a/airflow/jobs/scheduler_job.py
+++ b/airflow/jobs/scheduler_job.py
@@ -318,7 +318,7 @@ class SchedulerJob(BaseJob):
                 .filter(not_(DM.is_paused))
                 .filter(TI.state == TaskInstanceState.SCHEDULED)
                 .options(selectinload("dag_model"))
-                .order_by(-TI.priority_weight, DR.execution_date)
+                .order_by(-TI.priority_weight, DR.execution_date, TI.map_index)
             )
 
             if starved_pools: