The issue is a follow up to issue #8704 @rzo1
Currently, the isolation scheduler sorts the machines in decreasing order of assignable slots (total slots available). As the condition written in code is:
// returns list of list of slots, reverse sorted by number of slots
private LinkedList<HostAssignableSlots> hostAssignableSlots(Cluster cluster) {
List<WorkerSlot> assignableSlots = cluster.getAssignableSlots(); // getAssignableSlots here -> primary sort
// .....
// Sort Assignable slots by reverse number of slots
List<HostAssignableSlots> sortHostAssignSlots = new ArrayList<HostAssignableSlots>();
for (Map.Entry<String, List<WorkerSlot>> entry : hostAssignableSlots.entrySet()) {
sortHostAssignSlots.add(new HostAssignableSlots(entry.getKey(), entry.getValue()));
}
Collections.sort(sortHostAssignSlots, new Comparator<HostAssignableSlots>() {
@Override
public int compare(HostAssignableSlots o1, HostAssignableSlots o2) {
return o2.getWorkerSlots().size() - o1.getWorkerSlots().size();
}
});
return new LinkedList<HostAssignableSlots>(sortHostAssignSlots);
}
Why was the design choice taken to use getAssignableSlots instead of getAvailableSlots which takes number of free slots in consideration? If we sort by getAvailableSlots, we would choose machines with more number of free slots and have the less number of evictions.
My idea is that we can have a secondary sort where we check getAvailableSlots post getAssignableSlots in IsolationScheduler?
The issue is a follow up to issue #8704 @rzo1
Currently, the isolation scheduler sorts the machines in decreasing order of assignable slots (total slots available). As the condition written in code is:
Why was the design choice taken to use
getAssignableSlotsinstead ofgetAvailableSlotswhich takes number of free slots in consideration? If we sort bygetAvailableSlots, we would choose machines with more number of free slots and have the less number of evictions.My idea is that we can have a secondary sort where we check
getAvailableSlotspostgetAssignableSlotsin IsolationScheduler?