[ https://issues.apache.org/jira/browse/YARN-8978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
qiuliang updated YARN-8978: --------------------------- Flags: (was: Patch) Labels: (was: patch) Release Note: index 0ef90a1..d2b5ad7 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/FairSharePolicy.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/FairSharePolicy.java @@ -169,8 +169,13 @@ private int compareFairShareUsage(Schedulable s1, Schedulable s2, double useToWeightRatio1; double useToWeightRatio2; if (weight1 > 0.0 && weight2 > 0.0) { - useToWeightRatio1 = resourceUsage1.getMemorySize() / weight1; - useToWeightRatio2 = resourceUsage2.getMemorySize() / weight2; + if (resourceUsage1.getMemorySize() == 0 && resourceUsage2.getMemorySize() == 0){ + useToWeightRatio1 = ONE.getMemorySize() / weight1; + useToWeightRatio2 = ONE.getMemorySize() / weight2; + } else { + useToWeightRatio1 = resourceUsage1.getMemorySize() / weight1; + useToWeightRatio2 = resourceUsage2.getMemorySize() / weight2; + } } else { // Either weight1 or weight2 equals to 0 if (weight1 == weight2) { // If they have same weight, just compare usage was: 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/FairSharePolicy.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/FairSharePolicy.java index 0ef90a1..d2b5ad7 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/FairSharePolicy.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/FairSharePolicy.java @@ -169,8 +169,13 @@ private int compareFairShareUsage(Schedulable s1, Schedulable s2, double useToWeightRatio1; double useToWeightRatio2; if (weight1 > 0.0 && weight2 > 0.0) { - useToWeightRatio1 = resourceUsage1.getMemorySize() / weight1; - useToWeightRatio2 = resourceUsage2.getMemorySize() / weight2; + if (resourceUsage1.getMemorySize() == 0 && resourceUsage2.getMemorySize() == 0){ + useToWeightRatio1 = ONE.getMemorySize() / weight1; + useToWeightRatio2 = ONE.getMemorySize() / weight2; + } else { + useToWeightRatio1 = resourceUsage1.getMemorySize() / weight1; + useToWeightRatio2 = resourceUsage2.getMemorySize() / weight2; + } } else { // Either weight1 or weight2 equals to 0 if (weight1 == weight2) { // If they have same weight, just compare usage > For fair scheduler, application with higher priority should also get priority > resources for running AM > ------------------------------------------------------------------------------------------------------ > > Key: YARN-8978 > URL: https://issues.apache.org/jira/browse/YARN-8978 > Project: Hadoop YARN > Issue Type: Improvement > Components: fairscheduler > Reporter: qiuliang > Priority: Major > > In order to allow important applications to run earlier, we used priority > scheduling in the fair scheduler, and FairSharePolicy uses YARN-6307. > Considering this situation, there are two applications (with different > priorities) in the same queue and both are accepted. Both applications are > demanding and hungry when dispatched to the queue. Next, calculate the weight > ratio. Since the used resources of both applications are 0, the weight ratio > is also 0. The priority is invalid in this case. Low-priority applications > may get resources to run AM earlier than high-priority applications. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org