Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-2541

Race Condition in IndexCache(readIndexFileToCache,removeMap) causes value of totalMemoryUsed corrupt, which may cause TaskTracker continue throw Exception

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.20.1, 0.21.0, 0.22.0, 0.23.0
    • Fix Version/s: 0.23.0
    • Component/s: tasktracker
    • Labels:
      None
    • Environment:

      all

      Description

      The race condition goes like this:
      Thread1: readIndexFileToCache() totalMemoryUsed.addAndGet(newInd.getSize())
      Thread2: removeMap() totalMemoryUsed.addAndGet(-info.getSize());
      When SpillRecord is being read from fileSystem, client kills the job, info.getSize() equals 0, so in fact totalMemoryUsed is not reduced, but after thread1 finished reading SpillRecord, it adds the real index size to totalMemoryUsed, which makes the value of totalMemoryUsed wrong(larger).
      When this value(totalMemoryUsed) exceeds totalMemoryAllowed (this usually happens when a vary large job with vary large reduce number is killed by the user, probably because the user sets a wrong reduce number by mistake), and actually indexCache has not cache anything, freeIndexInformation() will throw exception constantly.

      A quick fix for this issue is to make removeMap() do nothing, let freeIndexInformation() do this job only.

      1. MAPREDUCE-2541.v2.patch
        4 kB
        Binglin Chang
      2. MAPREDUCE-2541.patch
        0.7 kB
        Binglin Chang

        Activity

          People

          • Assignee:
            Binglin Chang
            Reporter:
            Binglin Chang
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development