From f6850b89f36aa0a68a5d3a350be70d1a4eddb7a2 Mon Sep 17 00:00:00 2001 From: Hexiaoqiao Date: Sat, 29 Apr 2023 11:18:42 +0800 Subject: [PATCH] YARN-11482. Fix bug of DRF comparision DominantResourceFairnessComparator2 in fair scheduler. (#5607). Contributed by Xiaoqiao He. Reviewed-by: Shilun Fan (cherry picked from commit 70c0aa342e6a6a12b647bbfe30bb73313958e450) --- .../scheduler/fair/policies/DominantResourceFairnessPolicy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/DominantResourceFairnessPolicy.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/DominantResourceFairnessPolicy.java index 83af8b6494..7ddfff548e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/DominantResourceFairnessPolicy.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/policies/DominantResourceFairnessPolicy.java @@ -390,7 +390,7 @@ public int compare(Schedulable s1, Schedulable s2) { // share for that resource boolean s1Needy = resourceInfo1[dominant1].getValue() < minShareInfo1[dominant1].getValue(); - boolean s2Needy = resourceInfo1[dominant2].getValue() < + boolean s2Needy = resourceInfo2[dominant2].getValue() < minShareInfo2[dominant2].getValue(); int res;