[ 
https://issues.apache.org/jira/browse/HDFS-15787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17274212#comment-17274212
 ] 

Xiaoqiao He commented on HDFS-15787:
------------------------------------

Hi [~leosun08], it seems to execute different logic when the `leaseHolder` is 
null if we apply this patch. FYI.

> Remove unnecessary Lease Renew  in FSNamesystem#internalReleaseLease
> --------------------------------------------------------------------
>
>                 Key: HDFS-15787
>                 URL: https://issues.apache.org/jira/browse/HDFS-15787
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Lisheng Sun
>            Assignee: Lisheng Sun
>            Priority: Major
>         Attachments: HDFS-15787.001.patch
>
>
> The method of FSNamesystem#internalReleaseLease() as follow:
>  
> {code:java}
> boolean internalReleaseLease(Lease lease, String src, INodesInPath iip,
>     String recoveryLeaseHolder) throws IOException {
>   ...
>     // Start recovery of the last block for this file
>     // Only do so if there is no ongoing recovery for this block,
>     // or the previous recovery for this block timed out.
>     if (blockManager.addBlockRecoveryAttempt(lastBlock)) {
>       long blockRecoveryId = nextGenerationStamp(
>           blockManager.isLegacyBlock(lastBlock));
>       if(copyOnTruncate) {
>         lastBlock.setGenerationStamp(blockRecoveryId);
>       } else if(truncateRecovery) {
>         recoveryBlock.setGenerationStamp(blockRecoveryId);
>       }
>       uc.initializeBlockRecovery(lastBlock, blockRecoveryId, true);
>       // Cannot close file right now, since the last block requires recovery.
>       // This may potentially cause infinite loop in lease recovery
>       // if there are no valid replicas on data-nodes.
>       NameNode.stateChangeLog.warn(
>           "DIR* NameSystem.internalReleaseLease: " +
>               "File " + src + " has not been closed." +
>               " Lease recovery is in progress. " +
>               "RecoveryId = " + blockRecoveryId + " for block " + lastBlock);
>     }
>     lease = reassignLease(lease, src, recoveryLeaseHolder, pendingFile);
>     leaseManager.renewLease(lease);
>     break;
>   }
>   return false;
> }
> {code}
>  Call LeaseManager#renewLease in 
> FSNamesystem#reassignLease=>FSNamesystem#reassignLeaseInternal.
>  So no need to call LeaseManager#renewLease  again after 
> leaseManager#renewLease.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to