[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
@ -4087,14 +4087,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||||||
*/
|
*/
|
||||||
void renewLease(String holder) throws IOException {
|
void renewLease(String holder) throws IOException {
|
||||||
checkOperation(OperationCategory.WRITE);
|
checkOperation(OperationCategory.WRITE);
|
||||||
readLock();
|
checkNameNodeSafeMode("Cannot renew lease for " + holder);
|
||||||
try {
|
// fsn is not mutated so lock is not required. the leaseManger is also
|
||||||
checkOperation(OperationCategory.WRITE);
|
// thread-safe.
|
||||||
checkNameNodeSafeMode("Cannot renew lease for " + holder);
|
leaseManager.renewLease(holder);
|
||||||
leaseManager.renewLease(holder);
|
|
||||||
} finally {
|
|
||||||
readUnlock("renewLease");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user