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
This commit is contained in:
cxzl25 2023-04-26 04:41:11 +08:00 committed by GitHub
parent b6b9bd67bb
commit 5af0845076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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