Skip to content

[PROPOSAL] Isolation Scheduler Can Have Free Slots Check as a Secondary Sorting Check #8708

@meetjain74

Description

@meetjain74

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions