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