瀏覽代碼

HDFS-16672. Fix lease interval comparison in BlockReportLeaseManager (#4598). Contributed by dzcxzl.

Reviewed-by: He Xiaoqiao <hexiaoqiao@apache.org>
Signed-off-by: Ayush Saxena <ayushsaxena@apache.org
cxzl25 2 年之前
父節點
當前提交
5af0845076

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java

@@ -267,7 +267,7 @@ class BlockReportLeaseManager {
 
   private synchronized boolean pruneIfExpired(long monotonicNowMs,
                                               NodeData node) {
-    if (monotonicNowMs < node.leaseTimeMs + leaseExpiryMs) {
+    if (monotonicNowMs - node.leaseTimeMs < leaseExpiryMs) {
       return false;
     }
     LOG.info("Removing expired block report lease 0x{} for DN {}.",