ZanderXu commented on code in PR #4734:
URL: https://github.com/apache/hadoop/pull/4734#discussion_r944620657


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java:
##########
@@ -1765,6 +1765,9 @@ protected List<RemoteLocation> getLocationsForPath(String 
path,
           locs.add(loc);
         }
       }
+      if (locs.isEmpty()) {
+        throw new NoLocationException(path, 
this.subclusterResolver.getClass().getSimpleName());

Review Comment:
   fixed



##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRpc.java:
##########
@@ -1547,6 +1547,24 @@ public void testRenewLeaseWithMultiStream() throws 
Exception {
     }
   }
 
+  @Test
+  public void testMkdirWithDisableNameService() throws Exception {
+    MockResolver resolver = 
(MockResolver)router.getRouter().getSubclusterResolver();
+    String ns0 = cluster.getNameservices().get(0);
+    resolver.addLocation("/mnt", ns0, "/");
+    MockResolver activeNamenodeResolver = 
(MockResolver)router.getRouter().getNamenodeResolver();
+    activeNamenodeResolver.disableNamespace(ns0);
+
+    try {
+      FsPermission permission = new FsPermission("777");
+      LambdaTestUtils.intercept(NoLocationException.class,
+          () -> router.getRouter().getRpcServer()

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to