Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-7045

Fix NameNode deadlock when opening file under /.reserved path

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 2.6.0
    • namenode
    • None

    Description

      resolvePath could throw exception in following case, then deadlock.

      • open file under path /.reserved/raw using a non super user.
      • open file under path /.reserved/.inodes.

      FSNamesystem#getBlockLocationsUpdateTimes:

      ...
           if (isReadOp) { // first attempt is with readlock
              checkOperation(OperationCategory.READ);
              readLock();
            }  else { // second attempt is with  write lock
              checkOperation(OperationCategory.WRITE);
              writeLock(); // writelock is needed to set accesstime
            }
            src = resolvePath(src, pathComponents);
            try {
              ...
            } finally {
              if (isReadOp) {
                readUnlock();
              } else {
                writeUnlock();
              }
            }
      

      Attachments

        1. HDFS-7045.001.patch
          2 kB
          Yi Liu

        Issue Links

          Activity

            People

              hitliuyi Yi Liu
              hitliuyi Yi Liu
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: