[ https://issues.apache.org/jira/browse/HDFS-15787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17306096#comment-17306096 ]
Xiaoqiao He edited comment on HDFS-15787 at 3/22/21, 10:42 AM: --------------------------------------------------------------- Committed to trunk only. Thanks [~leosun08] for your works! Thanks [~ayushtkn] for your reviews and reminders! BTW, I just change the issue type to `improvement` from `BUG` since it is not wrong logic but duplicated invoke only. Please let me know if it is not proper. Thanks again. was (Author: hexiaoqiao): Committed to trunk only. Thanks [~leosun08] for your works! Thanks [~ayushtkn] for your reviews and reminders! > Remove unnecessary Lease Renew in FSNamesystem#internalReleaseLease > -------------------------------------------------------------------- > > Key: HDFS-15787 > URL: https://issues.apache.org/jira/browse/HDFS-15787 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: Lisheng Sun > Assignee: Lisheng Sun > Priority: Major > Fix For: 3.4.0 > > 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: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org