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

Fix NameNode deadlock when opening file under /.reserved path

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.0
    • Component/s: namenode
    • Labels:
      None
    • Target Version/s:

      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: