[HDFS-15789] Lease renewal does not require namesystem lock. Contributed by Daryn Sharp and Jim Brennan.
This commit is contained in:
parent
6184ab07f6
commit
f565476939
|
@ -4086,15 +4086,11 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
* Renew the lease(s) held by the given client
|
||||
*/
|
||||
void renewLease(String holder) throws IOException {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
readLock();
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
checkNameNodeSafeMode("Cannot renew lease for " + holder);
|
||||
// fsn is not mutated so lock is not required. the leaseManger is also
|
||||
// thread-safe.
|
||||
leaseManager.renewLease(holder);
|
||||
} finally {
|
||||
readUnlock("renewLease");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue