-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[FLINK-31510][yarn] Use getMemorySize instead of getMemory. #22207
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.(non-binding)
@@ -670,22 +670,22 @@ private ClusterSpecification validateClusterResources( | |||
|
|||
final String note = | |||
"Please check the 'yarn.scheduler.maximum-allocation-mb' and the 'yarn.nodemanager.resource.memory-mb' configuration values\n"; | |||
if (jobManagerMemoryMb > maximumResourceCapability.getMemory()) { | |||
if (jobManagerMemoryMb > maximumResourceCapability.getMemorySize()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, i think here memory unit is MB. so we can use int, why must long ?
Thanks @slfan1989 for creating this. How did you manually verify this issue, could you describe it in detail? By the way, would you mind resolving conflict in |
@reswqa Thank you very much for your suggestion, I will modify the information as soon as possible |
@reswqa Can you help review this PR again? Thank you very much! I explained the reason for possible negative numbers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tanks @slfan1989 for the update, I only have one question.
flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @slfan1989 for the update, would you mind squashing all to only one commit with the message like:
[FLINK-31510][yarn] Replace deprecated getMemory by getMemorySize
@reswqa Thank you for your help to review the code! I will rebase and submit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @slfan1989, LGTM.
What is the purpose of the change
JIRA: FLINK-31510. Use getMemorySize instead of getMemory
InYARN-4844, such a situation is described. We use int to represent memory (Unit MB). If a machine has 210GB of memory, the conversion to MB is 215040MB. If we have 10K machines, then 215040*10000=2150400000 > 2147483647 , accumulating memory will return a negative number.
In YARN-4844, use
getMemorySize
instead ofgetMemory
, useLong
type to represent memory instead of usingInt
type to represent memory.Resource#getMemory
Resource#getMemorySize
There is such a code in Flink to accumulate the memory returned by NM. This code may return a negative number.
YarnClusterDescriptor#getCurrentFreeClusterResources
Brief change log
Use getMemorySize instead of getMemory.
Verifying this change
Manually verified.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation