-
Notifications
You must be signed in to change notification settings - Fork 9.2k
YARN-4212. FairScheduler: Parent queues is not allowed to be 'Fair' policy if its children have the "drf" policy. #181
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
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.
Should we drop this line altogether?
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.
Sure.
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.
Should this check be in setPolicy or the FSQueue constructor instead?
For instance, FSLeafQueue#setPolicy already checks if the level is appropriate. This brings up another point - do we need this check of parent-child policies AND the depth? Should we get rid of depth either in this JIRA or a follow-up?
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.
Yes, my original thought is to do that in another JIRA. The depth and parent-child policy are not the same. It mighty a good idea to combine them since the logic of depth checking only prevent fifo policy to be non-leaf queue. The current implementation seems a bit heavy. I can do it in this JIRA.
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.
Initialize should likely go to setPolicy
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.
My first thought of this one is similar to the depth checking, planned to refactor it in next JIRA. Another question in my mind is - do we need to initialize policy every time setting the policy?
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.
setPolicy should likely be called in the constructor.
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.
It makes sense for this method to be boolean. I am not sure we should be throwing an exception here. The caller can decide that based on the return value.
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.
Based on my earlier comment, this should be return ! (childPolicy instanceof DominantResourceFairnessPolicy
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.
return false
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.
Can this be verifyAndSetPolicyFromConf, and part of FSQueue instead of FSParentQueue.
In that case, we will not need a separate call to setPolicy.
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.
Good idea!
…olicy if its children have the "drf" policy.
|
Thanks Karthik for the review, a new patch posted for your comments. |
kambatla
left a comment
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.
Nice work!
Since the subsequent changes are squashed into one commit, I ended up doing the review from scratch. Most comments are minor.
| import org.apache.hadoop.classification.InterfaceStability.Unstable; | ||
| import org.apache.hadoop.yarn.api.records.Resource; | ||
| import org.apache.hadoop.yarn.server.resourcemanager.resource.ResourceType; | ||
| import org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.AllocationConfigurationException; |
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.
Unused import.
| Resource queueUsage, Resource maxAvailable); | ||
|
|
||
| /** | ||
| * Check whether the policy of a child queue are allowed. |
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.
s/are/is
| * | ||
| * @param childPolicy the policy of child queue | ||
| */ | ||
| public boolean isChildPolicyAllowed(SchedulingPolicy childPolicy) { |
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.
Like that we are adding a non-abstract method.
| return SchedulingPolicy.DEPTH_ANY; | ||
| public boolean isChildPolicyAllowed(SchedulingPolicy childPolicy) { | ||
| if (childPolicy instanceof DominantResourceFairnessPolicy) { | ||
| LOG.info("Queue policies can't be " + DominantResourceFairnessPolicy.NAME |
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.
s/policies/policy
| if (childPolicy instanceof DominantResourceFairnessPolicy) { | ||
| LOG.info("Queue policies can't be " + DominantResourceFairnessPolicy.NAME | ||
| + " if the parent policy is " + getName() + ". Please choose " | ||
| + "other polices for child queues instead."); |
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.
IMO, we should either (1) not say anything about other policies or (2) list the policies that are allowed.
| /** | ||
| * Initialize a queue by setting its queue-specific properties and its | ||
| * metrics. | ||
| * metrics. This function don't set the policy for queues since there is |
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.
s/function/method - there is one other instance of this in the javadoc
s/don't/does not
Instead of saying there is different logic, can we call out what method does that for easier code navigability? And, it might be worth mentioning why that logic is separated, either here or at the other method.
| * @return true if no policy violation and successfully set polices | ||
| * for queues; false otherwise | ||
| */ | ||
| public boolean verifyAndSetPolicyFromConf(AllocationConfiguration queueConf) { |
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.
It might be worthwhile to point out the intended caller for this method.
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.
Fixed.
| } | ||
|
|
||
| @Test | ||
| public void testSchedulingPolicyViolation() throws IOException { |
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.
TestFairScheduler is awfully long. Can we please add these methods elsewhere? TestSchedulingPolicy and TestQueueManager are potential candidates.
| * | ||
| * @throws AllocationConfigurationException | ||
| */ | ||
| @Test(timeout = 1000) |
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.
Are all the cases in this test covered by other tests added here? If not, can we keep the test, maybe rename it, and capture the cases that are not covered?
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.
Add a new test case to check if fifo policy is only for leaf queues.
…olicy if its children have the "drf" policy.
kambatla
left a comment
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.
Let us fix the checkstyle issues along with the one nit.
| * different logic to do that. | ||
| * This function is invoked when a new queue is created or reloading the | ||
| * allocation configuration. | ||
| * metrics. This method is invoked when a new queue is created or reloading |
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.
Minor language comment. Let us use one of the following two:
- when creating a new queue or reloading the allocation file.
- when a new is created or the allocation file is reloaded.
…olicy if its children have the "drf" policy.
|
Committed. |
…arrierForVersionUpgrade The code changed significantly. I've rerun the test multiple times both with gradle and intelij. It passed every time. I suggest we enable it back. Author: Boris Shkolnik <boryas@apache.org> Reviewers: Xinyu Liu <xinyu@apache.org> Closes apache#181 from sborya/testZkBarrierForVersionUpgrade
No description provided.