Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-4134

FairScheduler preemption stops at queue level that all child queues are not over their fairshare

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: fairscheduler
    • Labels:
      None

      Description

      Now FairScheudler uses a choose-a-candidate method to select a container from leaf queues that to be preempted, in FSParentQueue.preemptContainer(),

          readLock.lock();
          try {
            for (FSQueue queue : childQueues) {
              if (candidateQueue == null ||
                  comparator.compare(queue, candidateQueue) > 0) {
                candidateQueue = queue;
              }
            }
          } finally {
            readLock.unlock();
          }
      
          // Let the selected queue choose which of its container to preempt
          if (candidateQueue != null) {
            toBePreempted = candidateQueue.preemptContainer();
          }
      

      a candidate child queue is selected. However, if the queue's usage isn't over it's fairshare, preemption will not happen:

          if (!preemptContainerPreCheck()) {
            return toBePreempted;
          }
      

      A scenario:

                  root
                 /    \
            queue1   queue2
                     /    \
                queue2.3, (  queue2.4  )
      

      suppose there're 8 containers, and queues at any level have the same weight. queue1 takes 4 and queue2.3 takes 4, so both queue1 and queue2 are at their fairshare. Now we submit an app in queue2.4 with 4 containers needs, it should preempt 2 from queue2.3, but the candidate-containers selection procedure will stop at queue1, so none of the containers will be preempted.

        Attachments

        1. YARN-4134.003.patch
          25 kB
          Xianyin Xin
        2. YARN-4134.002.patch
          24 kB
          Xianyin Xin
        3. YARN-4134.001.patch
          24 kB
          Xianyin Xin

          Issue Links

            Activity

              People

              • Assignee:
                xinxianyin Xianyin Xin
                Reporter:
                xinxianyin Xianyin Xin
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: