[
https://issues.apache.org/jira/browse/HDFS-15787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17275852#comment-17275852
]
Xiaoqiao He commented on HDFS-15787:
------------------------------------
Thanks [~leosun08] for your updates. it makes sense to me initial feeling about
v002.
I try do dig why involve it and renew lease twice originally but no result.
[~elgoiri] would you mind to have another checks? it seems that HDFS-11576
involve it at first. Thanks.
> 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, HDFS-15787.002.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: [email protected]
For additional commands, e-mail: [email protected]