Skip to content

Conversation

@singer-bin
Copy link
Contributor

Description of PR

JIRA: YARN-11633. [Federation] Improve LoadBasedRouterPolicy To Use Available vcores.

How was this patch tested?

unnecessary

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 21s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 31m 50s trunk passed
+1 💚 compile 0m 26s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 compile 0m 20s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 checkstyle 0m 18s trunk passed
+1 💚 mvnsite 0m 28s trunk passed
+1 💚 javadoc 0m 28s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 0m 24s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 spotbugs 0m 57s trunk passed
+1 💚 shadedclient 19m 44s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 20s the patch passed
+1 💚 compile 0m 18s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javac 0m 18s the patch passed
+1 💚 compile 0m 18s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 javac 0m 18s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 12s the patch passed
+1 💚 mvnsite 0m 21s the patch passed
+1 💚 javadoc 0m 17s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 0m 20s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 spotbugs 0m 51s the patch passed
+1 💚 shadedclient 19m 37s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 2m 34s hadoop-yarn-server-common in the patch passed.
+1 💚 asflicense 0m 23s The patch does not generate ASF License warnings.
82m 39s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6356/1/artifact/out/Dockerfile
GITHUB PR #6356
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux ca39b28900b4 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 1695037
Default Java Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6356/1/testReport/
Max. process+thread count 734 (vs. ulimit of 5500)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6356/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@slfan1989
Copy link
Contributor

slfan1989 commented Dec 14, 2023

@singer-bin Thank you for contribution!

YARN's scheduler compares based on memory by default. We can refer to FairSharePolicy.java.
Therefore, using memory for comparison in LoadBasedRouterPolicy is in line with the design rules of the scheduler.
From my personal perspective, I believe that using memory for comparison makes sense in the LoadBasedRouterPolicy.
So I think we should not increase the CPU limit here.

/**
 * Makes scheduling decisions by trying to equalize shares of memory.
 */
@Private
@Unstable
public class FairSharePolicy extends SchedulingPolicy {
  @VisibleForTesting
  public static final String NAME = "fair";
  private static final Logger LOG =
      LoggerFactory.getLogger(FairSharePolicy.class);
  private static final String MEMORY = ResourceInformation.MEMORY_MB.getName();
  private static final DefaultResourceCalculator RESOURCE_CALCULATOR =
      new DefaultResourceCalculator();
  private static final FairShareComparator COMPARATOR =
          new FairShareComparator();

  @Override
  public String getName() {
    return NAME;
  }
...

long availableMemory = getAvailableMemory(entry.getValue());
if (availableMemory > currBestMem) {
long availableVcore = getAvailableVcore(entry.getValue());
if (availableMemory > currBestMem && availableVcore > currBestVcore) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (availableMemory > currBestMem) {
 ....
}

This code is needed to select the largest subcluster of availableMemory. Memory is a more strictly limited resource, because without memory, the application cannot execute. Sufficient memory can also be considered as the cluster is idle.

If we add cpu constraints (availableVcore), subclusters with smaller memory may be selected, which is not an expected situation.

@slfan1989 slfan1989 changed the title YARN-11633.[Federation] Improve LoadBasedRouterPolicy To Use Availabl… YARN-11633.[Federation] Improve LoadBasedRouterPolicy To Use Available vcores. Dec 15, 2023
@singer-bin
Copy link
Contributor Author

@slfan1989 Thank you for your reply, I will close this PR. Where can I contact you, such as wechat, and I will ask you some questions.

@slfan1989
Copy link
Contributor

@slfan1989 Thank you for your reply, I will close this PR. Where can I contact you, such as wechat, and I will ask you some questions.

Sorry for the late reply, we can contact by email. @me below pr or jira, if I can understand the issue you describe, I will reply.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2025

We're closing this stale PR because it has been open for 100 days with no activity. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you feel like this was a mistake, or you would like to continue working on it, please feel free to re-open it and ask for a committer to remove the stale tag and review again.
Thanks all for your contribution.

@github-actions github-actions bot added the Stale label Oct 6, 2025
@github-actions github-actions bot closed this Oct 7, 2025
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.

3 participants