[HDFS-15789] Lease renewal does not require namesystem lock. Contributed by Daryn Sharp and Jim Brennan.
(cherry picked from commit f565476939
)
This commit is contained in:
parent
2c70705575
commit
37d8ad7ade
@ -4018,15 +4018,11 @@ void closeFileCommitBlocks(String src, INodeFile pendingFile,
|
|||||||
* Renew the lease(s) held by the given client
|
* Renew the lease(s) held by the given client
|
||||||
*/
|
*/
|
||||||
void renewLease(String holder) throws IOException {
|
void renewLease(String holder) throws IOException {
|
||||||
checkOperation(OperationCategory.WRITE);
|
|
||||||
readLock();
|
|
||||||
try {
|
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
checkNameNodeSafeMode("Cannot renew lease for " + holder);
|
checkNameNodeSafeMode("Cannot renew lease for " + holder);
|
||||||
|
// fsn is not mutated so lock is not required. the leaseManger is also
|
||||||
|
// thread-safe.
|
||||||
leaseManager.renewLease(holder);
|
leaseManager.renewLease(holder);
|
||||||
} finally {
|
|
||||||
readUnlock("renewLease");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user