You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Tsz Wo Nicholas Sze (JIRA)" <ji...@apache.org> on 2015/10/03 12:04:26 UTC

[jira] [Created] (HDFS-9194) AlreadyBeingCreatedException ... because pendingCreates is non-null but no leases found.

Tsz Wo Nicholas Sze created HDFS-9194:
-----------------------------------------

             Summary: AlreadyBeingCreatedException ... because pendingCreates is non-null but no leases found.
                 Key: HDFS-9194
                 URL: https://issues.apache.org/jira/browse/HDFS-9194
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: namenode
            Reporter: Tsz Wo Nicholas Sze
            Assignee: Tsz Wo Nicholas Sze


There is a possible bug in FSDirectory.addFile causing no leases found for under construction files.
{code}
//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();
    }
    ...
  }
{code}
- 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)