HDFS-14331. RBF: IOE While Removing Mount Entry. Contributed by Ayush Saxena.
This commit is contained in:
parent
1ce25e702b
commit
6cdf8db55c
@ -303,8 +303,15 @@ private void synchronizeQuota(String path, long nsQuota, long ssQuota)
|
||||
public RemoveMountTableEntryResponse removeMountTableEntry(
|
||||
RemoveMountTableEntryRequest request) throws IOException {
|
||||
// clear sub-cluster's quota definition
|
||||
synchronizeQuota(request.getSrcPath(), HdfsConstants.QUOTA_RESET,
|
||||
HdfsConstants.QUOTA_RESET);
|
||||
try {
|
||||
synchronizeQuota(request.getSrcPath(), HdfsConstants.QUOTA_RESET,
|
||||
HdfsConstants.QUOTA_RESET);
|
||||
} catch (Exception e) {
|
||||
// Ignore exception, if any while reseting quota. Specifically to handle
|
||||
// if the actual destination doesn't exist.
|
||||
LOG.warn("Unable to clear quota at the destinations for {}: {}",
|
||||
request.getSrcPath(), e.getMessage());
|
||||
}
|
||||
return getMountTableStore().removeMountTableEntry(request);
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -754,6 +755,12 @@ public void testClearQuotaDefAfterRemovingMountTable() throws Exception {
|
||||
assertNull(routerQuota);
|
||||
assertEquals(HdfsConstants.QUOTA_RESET, subClusterQuota.getQuota());
|
||||
assertEquals(HdfsConstants.QUOTA_RESET, subClusterQuota.getSpaceQuota());
|
||||
|
||||
// Verify removing mount entry with actual destinations not present.
|
||||
mountTable = MountTable.newInstance("/mount",
|
||||
Collections.singletonMap("ns0", "/testdir16"));
|
||||
addMountTable(mountTable);
|
||||
assertTrue(removeMountTable("/mount"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user