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

AlreadyBeingCreatedException ... because pendingCreates is non-null but no leases found.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • namenode
    • None

    Description

      There is a possible bug in FSDirectory.addFile causing no leases found for under construction files.

      //FSDirectory
        INodeFile addFile(String path, PermissionStatus permissions,
                          short replication, long preferredBlockSize,
                          String clientName, String clientMachine)
          throws FileAlreadyExistsException, QuotaExceededException,
            UnresolvedLinkException, SnapshotAccessControlException, AclException {
      
          long modTime = now();
          INodeFile newNode = newINodeFile(namesystem.allocateNewInodeId(),
              permissions, modTime, modTime, replication, preferredBlockSize);
          newNode.toUnderConstruction(clientName, clientMachine);
          boolean added = false;
          writeLock();
          try {
            added = addINode(path, newNode);
          } finally {
            writeUnlock();
          }
          ...
        }
      
      • newNode.toUnderConstruction(clientName, clientMachine) adds FileUnderConstructionFeature to the INode, i.e. the file becomes an under construction file. At this moment, there is no lease for this file yet. The lease will be added later in FSNamesystem.startFileInternal(..).
      • It is possible that addINode(path, newNode) adds the inode to the namespace tree but throws QuotaExceededException later on when calling updateModificationTime. (i.e. addINode -> addLastINode -> addChild -> parent.addChild -> updateModificationTime throws QuotaExceededException) Then, the newly added uc file is left in namespace but the corresponding lease won't be added.

      Attachments

        Issue Links

          Activity

            People

              szetszwo Tsz-wo Sze
              szetszwo Tsz-wo Sze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: