[ https://issues.apache.org/jira/browse/HDFS-16017?focusedWorklogId=594094&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-594094 ]
ASF GitHub Bot logged work on HDFS-16017: ----------------------------------------- Author: ASF GitHub Bot Created on: 10/May/21 16:31 Start Date: 10/May/21 16:31 Worklog Time Spent: 10m Work Description: goiri commented on a change in pull request #2993: URL: https://github.com/apache/hadoop/pull/2993#discussion_r629504887 ########## File path: hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRpc.java ########## @@ -513,6 +513,44 @@ public void testProxyListFilesLargeDir() throws IOException { } } + @Test + public void testProxyListFilesWithOverwrite() throws IOException { + // Create a parent point as well as a subfolder mount + // /parent + // ns0 -> /parent + // /parent/sub1 + // ns0 -> /parent/sub1 + String parent = "/parent"; + String sub1 = parent + "/sub1"; + Path parentPath = new Path(parent); + // Add mount point + for (RouterContext rc : cluster.getRouters()) { + MockResolver resolver = + (MockResolver) rc.getRouter().getSubclusterResolver(); + resolver.addLocation(parent, ns, parent); + resolver.addLocation(sub1, ns, sub1); + } + // The sub1 folder created is the same as the sub1 mount point directory + nnFS.mkdirs(new Path(sub1)); + + FileStatus[] routerFsResult = routerFS.listStatus(parentPath); + FileStatus[] nnFsResult = nnFS.listStatus(parentPath); + // Checking + assertEquals(1, routerFsResult.length); + assertEquals(1, nnFsResult.length); + + FileStatus nnFileStatus = nnFsResult[0]; + FileStatus routerFileStatus = routerFsResult[0]; + + assert nnFileStatus != null; Review comment: Let's do a unit test assert instead. -- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 594094) Time Spent: 0.5h (was: 20m) > RBF: The getListing method should not overwrite the Listings returned by the > NameNode > ------------------------------------------------------------------------------------- > > Key: HDFS-16017 > URL: https://issues.apache.org/jira/browse/HDFS-16017 > Project: Hadoop HDFS > Issue Type: Improvement > Affects Versions: 3.3.1 > Reporter: zhu > Priority: Major > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > Regarding the getListing method, when the directory returned by NameNode is a > mount point in MountTable, the list returned by Namenode shall prevail. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org