[
https://issues.apache.org/jira/browse/HDFS-15554?focusedWorklogId=478944&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-478944
]
ASF GitHub Bot logged work on HDFS-15554:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Sep/20 05:44
Start Date: 04/Sep/20 05:44
Worklog Time Spent: 10m
Work Description: fengnanli commented on a change in pull request #2266:
URL: https://github.com/apache/hadoop/pull/2266#discussion_r483399376
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterAdminServer.java
##########
@@ -562,11 +595,35 @@ public GetDestinationResponse getDestination(
LOG.error("Cannot get location for {}: {}",
src, ioe.getMessage());
}
- if (nsIds.isEmpty() && !locations.isEmpty()) {
- String nsId = locations.get(0).getNameserviceId();
- nsIds.add(nsId);
+ return nsIds;
+ }
+
+ /**
+ * Verify the file exists in destination nameservices to avoid dangling
+ * mount points.
+ *
+ * @param entry the new mount points added, could be from add or update.
+ * @return destination nameservices where the file doesn't exist.
+ * @throws IOException
+ */
+ private List<String> verifyFileInDestinations(MountTable entry)
Review comment:
@goiri Uploaded an early version of trying to fix all tests. This is
pretty tedious work so before I spend more time on this, let me know your
thoughts.
There are mainly two types of tests when dealing with mount table:
1. Use mock RouterRpcServer and so on, this way no downstream namenode calls
are made. I put the mock as well, see the change for TestRouterAdmin.java
2. Use real downstream namenode interaction, see TestRouterMountTable.java.
I created the paths before calling mount points change.
I kept thinking a much easier way is to add a Router server side config to
turn this on and the default is on. In the tests I can just turn the config off
explicitly and this way I don't need to deal with individual tests.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 478944)
Time Spent: 1.5h (was: 1h 20m)
> RBF: force router check file existence in destinations before adding/updating
> mount points
> ------------------------------------------------------------------------------------------
>
> Key: HDFS-15554
> URL: https://issues.apache.org/jira/browse/HDFS-15554
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: Fengnan Li
> Assignee: Fengnan Li
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> Adding/Updating mount points right now is only a router action without
> validation in the downstream namenodes for the destination files/directories.
> In practice we have set up the dangling mount points and when clients call
> listStatus they would get the file returned, but then if they try to access
> the file FileNotFoundException would be thrown out.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]