Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.3.0, 3.2.1, 3.1.3
-
None
Description
TestProportionalCapacityPreemptionPolicy#testPreemptionWithVCoreResource is preempting more containers than would happen on a real cluster.
This is because the process for mocking CS queues in TestProportionalCapacityPreemptionPolicy fails to take into consideration vcores when mocking effective max resources.
This causes miscalculations for how many vcores to preempt when the DRF is being used in the test:
Resource absMaxCapIdealAssignedDelta = Resources.componentwiseMax( Resources.subtract(getMax(), idealAssigned), Resource.newInstance(0, 0));
In the above code, the preemption policy is offering resources to an underserved queue. getMax() will use the effective max resource if it exists. Since this test is mocking effective max resources, it will return that value. However, since the mock doesn't include vcores, the test treats memory as the dominant resource and awards too many preempted containers to the underserved queue.