From 03a3a04c064f1fd733411ffa9c6b03d85e0a92c9 Mon Sep 17 00:00:00 2001 From: He Xiaoqiao Date: Mon, 22 Mar 2021 18:37:00 +0800 Subject: [PATCH] HDFS-15787. Remove unnecessary Lease Renew in FSNamesystem#internalReleaseLease. Contributed by Lisheng Sun. Signed-off-by: Ayush Saxena Signed-off-by: He Xiaoqiao --- .../org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index c6902b8ea2..7d9f78c064 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -3786,7 +3786,9 @@ boolean internalReleaseLease(Lease lease, String src, INodesInPath iip, "RecoveryId = " + blockRecoveryId + " for block " + lastBlock); } lease = reassignLease(lease, src, recoveryLeaseHolder, pendingFile); - leaseManager.renewLease(lease); + if (recoveryLeaseHolder == null) { + leaseManager.renewLease(lease); + } break; } return false;