You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by in...@apache.org on 2019/03/04 21:58:29 UTC

[hadoop] branch HDFS-13891 updated: HDFS-14331. RBF: IOE While Removing Mount Entry. Contributed by Ayush Saxena.

This is an automated email from the ASF dual-hosted git repository.

inigoiri pushed a commit to branch HDFS-13891
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/HDFS-13891 by this push:
     new 1d1dc8e  HDFS-14331. RBF: IOE While Removing Mount Entry. Contributed by Ayush Saxena.
1d1dc8e is described below

commit 1d1dc8e309875c238d46ac450e61e5260f300092
Author: Inigo Goiri <in...@apache.org>
AuthorDate: Mon Mar 4 13:57:48 2019 -0800

    HDFS-14331. RBF: IOE While Removing Mount Entry. Contributed by Ayush Saxena.
---
 .../hdfs/server/federation/router/RouterAdminServer.java      | 11 +++++++++--
 .../hadoop/hdfs/server/federation/router/TestRouterQuota.java |  7 +++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterAdminServer.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterAdminServer.java
index a2a5a42..97d4d16 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterAdminServer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterAdminServer.java
@@ -303,8 +303,15 @@ public class RouterAdminServer extends AbstractService
   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);
   }
 
diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterQuota.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterQuota.java
index 034023c..abcbe8f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterQuota.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterQuota.java
@@ -20,6 +20,7 @@ package org.apache.hadoop.hdfs.server.federation.router;
 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 class TestRouterQuota {
     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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org