wilfred-s commented on a change in pull request #356:
URL:
https://github.com/apache/incubator-yunikorn-core/pull/356#discussion_r781738962
##########
File path: pkg/scheduler/partition.go
##########
@@ -704,6 +704,28 @@ func (pc *PartitionContext) removeNodeAllocations(node
*objects.Node) ([]*object
if alloc.NodeID != release.NodeID {
// ignore the return as that is the
same as alloc, the alloc is gone after this call
_ = app.ReplaceAllocation(allocID)
+ // we need to check the resources
equality
+ delta :=
resources.Sub(release.AllocatedResource, alloc.AllocatedResource)
+ // Any negative value in the delta
means that at least one of the requested resource in the
+ // placeholder is larger than the real
allocation. The nodes are correct the queue needs adjusting.
+ // The reverse case is handled during
allocation.
+ if delta.HasNegativeValue() {
+ // this looks incorrect but the
delta is negative and the result will be a real decrease
+ err :=
app.GetQueue().IncAllocatedResource(delta, false)
Review comment:
The update of the queue is enclosed in a check for nodeID difference
(line 704 - 740). The last line of that block is a continue call (line 739)
which starts processing the next allocation (for loop). If and when we get into
the block we can never reach line 770 which does the queue update for the other
cases.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]