Skip to content

YARN-11003. Make RMNode aware of all (OContainer inclusive) allocated resources #3646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 23, 2021

Conversation

afchung
Copy link
Contributor

@afchung afchung commented Nov 11, 2021

Description of PR

  • Adds a new method in RMNode: getAllocatedContainerResource, which
    records how much resource is allocated to containers on a node
  • Adds up RUNNING and NEW container resources in HB loop to keep track
    of resources allocated for containers

How was this patch tested?

  • Unit test
  • Deployment in a production cluster

… resources

* Adds a new method in RMNode: getAllocatedContainerResource, which
records how much resource is allocated to containers on a node
* Adds up RUNNING and NEW container resources in HB loop to keep track
of resources allocated for containers
newContainerStatusFromNode, runningContainerStatusFromNode))
.when(statusEventFromNode1).getContainers();
node.handle(statusEventFromNode1);
Assert.assertTrue(Resources.equals(
Copy link
Member

Choose a reason for hiding this comment

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

Resource has equals which actual is called by this, can't we just use assertEquals()?

rmContext.getRMApps().put(app0, Mockito.mock(RMApp.class));

RMNodeStatusEvent statusEventFromNode1 = getMockRMNodeStatusEvent(null);
ContainerStatus newContainerStatusFromNode = mock(ContainerStatus.class);
Copy link
Member

Choose a reason for hiding this comment

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

Can we create this mock in a static method to make the test easier to read?

.when(statusEventFromNode2).getContainers();

node.handle(statusEventFromNode2);
Assert.assertTrue(Resources.equals(
Copy link
Member

Choose a reason for hiding this comment

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

assertEquals()

@afchung
Copy link
Contributor Author

afchung commented Nov 11, 2021

@goiri thanks for the review! Have pushed a new commit to address your comments.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 48s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 12m 44s Maven dependency ordering for branch
+1 💚 mvninstall 23m 8s trunk passed
+1 💚 compile 23m 35s trunk passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 compile 20m 13s trunk passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 checkstyle 3m 53s trunk passed
+1 💚 mvnsite 2m 3s trunk passed
+1 💚 javadoc 1m 50s trunk passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javadoc 1m 41s trunk passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 spotbugs 3m 22s trunk passed
+1 💚 shadedclient 21m 39s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 30s Maven dependency ordering for patch
+1 💚 mvninstall 1m 21s the patch passed
+1 💚 compile 24m 28s the patch passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javac 24m 28s the patch passed
+1 💚 compile 20m 25s the patch passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 javac 20m 25s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 3m 58s the patch passed
+1 💚 mvnsite 1m 55s the patch passed
+1 💚 javadoc 1m 46s the patch passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javadoc 1m 39s the patch passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 spotbugs 3m 28s the patch passed
+1 💚 shadedclient 21m 8s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 96m 38s hadoop-yarn-server-resourcemanager in the patch passed.
+1 💚 unit 12m 37s hadoop-sls in the patch passed.
+1 💚 asflicense 0m 59s The patch does not generate ASF License warnings.
310m 0s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/1/artifact/out/Dockerfile
GITHUB PR #3646
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell
uname Linux c3b60e1341bd 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 9e60671
Default Java Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/1/testReport/
Max. process+thread count 976 (vs. ulimit of 5500)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager hadoop-tools/hadoop-sls U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 58s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 12m 38s Maven dependency ordering for branch
+1 💚 mvninstall 24m 35s trunk passed
+1 💚 compile 23m 30s trunk passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 compile 19m 50s trunk passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 checkstyle 3m 55s trunk passed
+1 💚 mvnsite 1m 45s trunk passed
+1 💚 javadoc 1m 31s trunk passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javadoc 1m 22s trunk passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 spotbugs 3m 0s trunk passed
+1 💚 shadedclient 23m 28s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 50s Maven dependency ordering for patch
+1 💚 mvninstall 1m 22s the patch passed
+1 💚 compile 22m 38s the patch passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javac 22m 38s the patch passed
+1 💚 compile 20m 4s the patch passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 javac 20m 4s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 3m 50s /results-checkstyle-root.txt root: The patch generated 2 new + 87 unchanged - 2 fixed = 89 total (was 89)
+1 💚 mvnsite 1m 45s the patch passed
+1 💚 javadoc 1m 27s the patch passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javadoc 1m 23s the patch passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 spotbugs 3m 19s the patch passed
+1 💚 shadedclient 22m 53s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 104m 59s hadoop-yarn-server-resourcemanager in the patch passed.
+1 💚 unit 12m 13s hadoop-sls in the patch passed.
+1 💚 asflicense 0m 50s The patch does not generate ASF License warnings.
317m 40s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/2/artifact/out/Dockerfile
GITHUB PR #3646
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell
uname Linux f913f494955d 4.15.0-147-generic #151-Ubuntu SMP Fri Jun 18 19:21:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / b6ae804
Default Java Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/2/testReport/
Max. process+thread count 955 (vs. ulimit of 5500)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager hadoop-tools/hadoop-sls U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/2/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.


// Adding completed containers should not have changed
// the resources allocated
Assert.assertEquals(node.getAllocatedContainerResource(),
Copy link
Member

Choose a reason for hiding this comment

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

Usually we would put the expected first in the assertEquals

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 53s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 12m 56s Maven dependency ordering for branch
+1 💚 mvninstall 22m 1s trunk passed
+1 💚 compile 21m 57s trunk passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 compile 19m 19s trunk passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 checkstyle 3m 43s trunk passed
+1 💚 mvnsite 2m 4s trunk passed
+1 💚 javadoc 1m 50s trunk passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javadoc 1m 45s trunk passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 spotbugs 3m 14s trunk passed
+1 💚 shadedclient 22m 23s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 28s Maven dependency ordering for patch
+1 💚 mvninstall 1m 24s the patch passed
+1 💚 compile 22m 23s the patch passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javac 22m 23s the patch passed
+1 💚 compile 19m 9s the patch passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 javac 19m 9s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 3m 37s /results-checkstyle-root.txt root: The patch generated 2 new + 87 unchanged - 2 fixed = 89 total (was 89)
+1 💚 mvnsite 2m 4s the patch passed
+1 💚 javadoc 1m 48s the patch passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javadoc 1m 43s the patch passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 spotbugs 3m 35s the patch passed
+1 💚 shadedclient 21m 8s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 96m 4s hadoop-yarn-server-resourcemanager in the patch passed.
+1 💚 unit 12m 40s hadoop-sls in the patch passed.
+1 💚 asflicense 1m 1s The patch does not generate ASF License warnings.
303m 20s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/3/artifact/out/Dockerfile
GITHUB PR #3646
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell
uname Linux 0dc4f999a317 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 2ee6bf8
Default Java Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/3/testReport/
Max. process+thread count 966 (vs. ulimit of 5500)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager hadoop-tools/hadoop-sls U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/3/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@bibinchundatt bibinchundatt self-requested a review November 16, 2021 09:08
@@ -104,6 +105,14 @@
*/
public Resource getTotalCapability();

/**
* the total allocated resources to containers.
Copy link
Contributor

@bibinchundatt bibinchundatt Nov 16, 2021

Choose a reason for hiding this comment

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

Start with upper case in comments.. This will include the sum of O+G containers queued + running + paused on the node.. Comment cane be more explanatory..

@afchung
Copy link
Contributor Author

afchung commented Nov 16, 2021

@bibinchundatt thanks for the review! Updated the PR to address your comments.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 52s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 12m 49s Maven dependency ordering for branch
+1 💚 mvninstall 21m 36s trunk passed
+1 💚 compile 21m 51s trunk passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 compile 20m 7s trunk passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 checkstyle 3m 41s trunk passed
+1 💚 mvnsite 1m 50s trunk passed
+1 💚 javadoc 1m 41s trunk passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javadoc 1m 37s trunk passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 spotbugs 3m 3s trunk passed
+1 💚 shadedclient 21m 5s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 27s Maven dependency ordering for patch
+1 💚 mvninstall 1m 37s the patch passed
+1 💚 compile 29m 17s the patch passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javac 29m 17s the patch passed
+1 💚 compile 25m 24s the patch passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 javac 25m 24s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 4m 36s /results-checkstyle-root.txt root: The patch generated 3 new + 87 unchanged - 2 fixed = 90 total (was 89)
+1 💚 mvnsite 2m 2s the patch passed
+1 💚 javadoc 1m 48s the patch passed with JDK Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04
+1 💚 javadoc 1m 38s the patch passed with JDK Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
+1 💚 spotbugs 3m 59s the patch passed
+1 💚 shadedclient 27m 21s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 114m 6s hadoop-yarn-server-resourcemanager in the patch passed.
+1 💚 unit 12m 29s hadoop-sls in the patch passed.
+1 💚 asflicense 1m 1s The patch does not generate ASF License warnings.
340m 2s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/4/artifact/out/Dockerfile
GITHUB PR #3646
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell
uname Linux 804452b08978 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 7457e09
Default Java Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.11+9-Ubuntu-0ubuntu2.20.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_292-8u292-b10-0ubuntu1~20.04-b10
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/4/testReport/
Max. process+thread count 948 (vs. ulimit of 5500)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager hadoop-tools/hadoop-sls U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-3646/4/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0-SNAPSHOT https://yetus.apache.org

This message was automatically generated.

@goiri goiri merged commit 5b1b2c8 into apache:trunk Nov 23, 2021
HarshitGupta11 pushed a commit to HarshitGupta11/hadoop that referenced this pull request Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants