diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java index 3560a36dde..2dc4a2b0e6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockReportLeaseManager.java @@ -267,7 +267,7 @@ public synchronized long requestLease(DatanodeDescriptor dn) { 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 {}.",