-
Notifications
You must be signed in to change notification settings - Fork 239
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
[YUNIKORN-2795] Handle Preemption cases between two siblings without … #944
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #944 +/- ##
==========================================
+ Coverage 80.41% 80.43% +0.02%
==========================================
Files 97 97
Lines 12431 12437 +6
==========================================
+ Hits 9996 10004 +8
+ Misses 2164 2163 -1
+ Partials 271 270 -1 ☔ View full report in Codecov by Sentry. |
var smallestRes = resources.NewResourceFromMap(map[string]resources.Quantity{"first": 5}) | ||
var childRes = resources.NewResourceFromMap(map[string]resources.Quantity{"second": 5}) | ||
var smallestResPlusChildRes = resources.Add(smallestRes, childRes) | ||
var smallestResDouble = resources.Multiply(smallestRes, 2) | ||
var smallestResDoublePlusChildRes = resources.Add(resources.Multiply(smallestRes, 2), childRes) | ||
var smallestResMultiplyByZero = resources.NewResourceFromMap(map[string]resources.Quantity{"first": 0}) | ||
var smallestResMultiplyByMinusOne = resources.Multiply(smallestRes, -1) | ||
var smallestResMultiplyByMinusOnePlusChildRes = resources.Add(resources.Multiply(smallestRes, -1), childRes) | ||
var childResMultiplyByZero = resources.NewResourceFromMap(map[string]resources.Quantity{"second": 0}) | ||
var childResMultiplyByMinusOne = resources.Multiply(childRes, -1) | ||
var childResDouble = resources.Multiply(childRes, 2) | ||
var smallestResDoublePlusChildResDouble = resources.Add(resources.Multiply(smallestRes, 2), childResDouble) | ||
var smallestResPlusChildResDouble = resources.Add(smallestRes, childResDouble) | ||
var smallestResMultiplyByZeroPluschildResMultiplyByZero = resources.Add(smallestResMultiplyByZero, childResMultiplyByZero) | ||
var smallestResMultiplyByZeroPluschildResMultiplyByMinusOne = resources.Add(smallestResMultiplyByZero, childResMultiplyByMinusOne) |
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.
Wouldn't it be better to just create the resource map in-place wherever it's needed? These variables barely reveal what they contain, the names are way too long sometimes.
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.
Agree with this, please simplify.
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.
Simplified the variable names like usual test variables. Couple of jiras YUNIKORN-2848 & YUNIKORN-2824 has been already raised which would re-use these variables eventually.
This needs a rebase on master now that SubOnlyExisting() has been updated. |
9d8607a
to
3704db9
Compare
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 changes.
var smallestRes = resources.NewResourceFromMap(map[string]resources.Quantity{"first": 5}) | ||
var childRes = resources.NewResourceFromMap(map[string]resources.Quantity{"second": 5}) | ||
var smallestResPlusChildRes = resources.Add(smallestRes, childRes) | ||
var smallestResDouble = resources.Multiply(smallestRes, 2) | ||
var smallestResDoublePlusChildRes = resources.Add(resources.Multiply(smallestRes, 2), childRes) | ||
var smallestResMultiplyByZero = resources.NewResourceFromMap(map[string]resources.Quantity{"first": 0}) | ||
var smallestResMultiplyByMinusOne = resources.Multiply(smallestRes, -1) | ||
var smallestResMultiplyByMinusOnePlusChildRes = resources.Add(resources.Multiply(smallestRes, -1), childRes) | ||
var childResMultiplyByZero = resources.NewResourceFromMap(map[string]resources.Quantity{"second": 0}) | ||
var childResMultiplyByMinusOne = resources.Multiply(childRes, -1) | ||
var childResDouble = resources.Multiply(childRes, 2) | ||
var smallestResDoublePlusChildResDouble = resources.Add(resources.Multiply(smallestRes, 2), childResDouble) | ||
var smallestResPlusChildResDouble = resources.Add(smallestRes, childResDouble) | ||
var smallestResMultiplyByZeroPluschildResMultiplyByZero = resources.Add(smallestResMultiplyByZero, childResMultiplyByZero) | ||
var smallestResMultiplyByZeroPluschildResMultiplyByMinusOne = resources.Add(smallestResMultiplyByZero, childResMultiplyByMinusOne) |
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.
Agree with this, please simplify.
b972092
to
ad11714
Compare
This failure should go away with apache/yunikorn-k8shim#897. Triggering the workflows to get a clean build. |
apache/yunikorn-k8shim#897 merged; I've kicked off the build on the PR again to verify. |
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.
+1 LGTM.
…causing preemption loop
What is this PR for?
Different preemption cases between siblings under common under guaranteed parent needs to be handled properly without causing preemption storm or loop. Please refer https://docs.google.com/document/d/1vfv8XJJsIqlZN3ecyhP2EFeiUSQnY-9GHEi_UJFB-BU/edit for more details.
A fixable case without causing storm or loop is freeing up resources from victim child queue (not guaranteed set) to under guaranteed preemptor who is starving for resources located under common under guaranteed parent. This case has been discussed in the doc under section 2a)
What type of PR is it?
Todos
What is the Jira issue?
https://issues.apache.org/jira/browse/YUNIKORN-2795
How should this be tested?
Screenshots (if appropriate)
Questions: