slfan1989 commented on code in PR #8815:
URL: https://github.com/apache/hadoop/pull/8815#discussion_r4658597100
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/reservation/CapacityOverTimePolicy.java:
##########
@@ -111,17 +111,24 @@ public void validate(Plan plan, ReservationAllocation
reservation)
consumptionForUserOverTime =
RLESparseResourceAllocation.merge(plan.getResourceCalculator(),
plan.getTotalCapacity(), consumptionForUserOverTime,
- old.getResourcesOverTime(checkStart, checkEnd), RLEOperator.add,
- checkStart, checkEnd);
+ old.getResourcesOverTime(checkStart, checkEnd),
+ RLEOperator.subtract, checkStart, checkEnd);
Review Comment:
Could we add a regression case where an existing reservation is updated
while another reservation for the same user is still active at `checkEnd` ?
The subtraction merge also inserts an end marker at `checkEnd`, so I'd like
to verify that this path still accepts an update within quota.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]