Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-4149

JobQueueJobInProgressListener.jobUpdated() might not work as expected

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.19.0
    • 0.19.0
    • None
    • None
    • Reviewed

    Description

      JobQueueJobInProgressListener uses a TreeSet to store the sorted collection of JobInProgress objects. The comparator used to sort the JIPs follow the following order

      • priority (>=)
      • start time (<=)
      • job id [jt-identifier, job-index] (<=)

      If any JIP object is changed w.r.t priority or start-time, then the TreeSet will be inconsistent. Hence doing a delete might not work. Consider the following
      1) jobs are submitted in the following order

      number jobid priority
      1 j1 NORMAL
      2 j2 LOW
      3 j3 NORMAL

      2) The sorted collection will be in the order : j1,j3,j2

      3) If job3's priority is changed to LOW then the collection wont change but delete will bail out on j1 itself as the comparator will return a -ve number. TreeSet uses the comparator both for sorting and deleting. If i indicates the index in the collection and obj represents the object under consideration, then looks like TreeSet.remove(obj) follows something like :

      • continue to search if the compare(i, obj) is -ve
      • bail out if the compare(i, obj) is +ve
      • delete the obj of compare(i,obj) == 0

      Attachments

        1. HADOOP-4149-v1.5.patch
          26 kB
          Amar Kamat
        2. HADOOP-4149-v1.7.patch
          28 kB
          Amar Kamat

        Issue Links

          Activity

            People

              amar_kamat Amar Kamat
              amar_kamat Amar Kamat
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: