[ https://issues.apache.org/jira/browse/YARN-2637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14253048#comment-14253048 ]
Wangda Tan commented on YARN-2637: ---------------------------------- Hi [~cwelch], bq. Regarding "FiCaSchedulerApp constructor: Tests were depending on the previous, incorrect behavior to run ...", I think that is fine if we have to change a lot of tests to avod such null checking. bq. Tests were depending on the previous, incorrect behavior to run I think there should at least one AM can be launched in each queue, otherwise the queue totally makes no sense. Imaging a user can see a queue and cluster has available resource, but app in the queue is still pending. I think we can fix the issue together in this ticket, or file a separate JIRA, I prefer previous one. And in addition, we should see how many tests will fail instead of set value here. We should not add hard code such configuration in MockRM's constructor, a developer may write unit test like {code} Configuration conf = new Configuration(..); conf.set(AM_RESOURCE, 0.123f); MockRM rm = new MockRM(conf); {code} Because the AM_RESOURCE value will be overwritten in new MockRM's logic. bq. -re maximumActiveApplications - this is a good question. Before this change it was possible to effectively set this value by just doing a bit of math because the "pretend" AM size was a fixed value. I just thought it is not correct, as you mentioned, we shouldn't have logic depend on this incorrect behavior, it is not a backward compatible change to me, it is just leave some necessary logic in implementation/configuration. If a user wants to specify #app in a queue just doing tests, set a proper AM_PERCENTAGE and also launches AM with fixed capacity will be a very easy way, do I under-estimate this problem? Thanks, Wangda > maximum-am-resource-percent could be violated when resource of AM is > > minimumAllocation > ---------------------------------------------------------------------------------------- > > Key: YARN-2637 > URL: https://issues.apache.org/jira/browse/YARN-2637 > Project: Hadoop YARN > Issue Type: Bug > Components: resourcemanager > Affects Versions: 2.6.0 > Reporter: Wangda Tan > Assignee: Craig Welch > Priority: Critical > Attachments: YARN-2637.0.patch, YARN-2637.1.patch, > YARN-2637.12.patch, YARN-2637.13.patch, YARN-2637.15.patch, > YARN-2637.16.patch, YARN-2637.17.patch, YARN-2637.18.patch, > YARN-2637.19.patch, YARN-2637.2.patch, YARN-2637.6.patch, YARN-2637.7.patch, > YARN-2637.9.patch > > > Currently, number of AM in leaf queue will be calculated in following way: > {code} > max_am_resource = queue_max_capacity * maximum_am_resource_percent > #max_am_number = max_am_resource / minimum_allocation > #max_am_number_for_each_user = #max_am_number * userlimit * userlimit_factor > {code} > And when submit new application to RM, it will check if an app can be > activated in following way: > {code} > for (Iterator<FiCaSchedulerApp> i=pendingApplications.iterator(); > i.hasNext(); ) { > FiCaSchedulerApp application = i.next(); > > // Check queue limit > if (getNumActiveApplications() >= getMaximumActiveApplications()) { > break; > } > > // Check user limit > User user = getUser(application.getUser()); > if (user.getActiveApplications() < > getMaximumActiveApplicationsPerUser()) { > user.activateApplication(); > activeApplications.add(application); > i.remove(); > LOG.info("Application " + application.getApplicationId() + > " from user: " + application.getUser() + > " activated in queue: " + getQueueName()); > } > } > {code} > An example is, > If a queue has capacity = 1G, max_am_resource_percent = 0.2, the maximum > resource that AM can use is 200M, assuming minimum_allocation=1M, #am can be > launched is 200, and if user uses 5M for each AM (> minimum_allocation). All > apps can still be activated, and it will occupy all resource of a queue > instead of only a max_am_resource_percent of a queue. -- This message was sent by Atlassian JIRA (v6.3.4#6332)