HDFS-13842. RBF: Exceptions are conflicting when creating the same mount entry twice. Contributed by Ranith Sardar.

This commit is contained in:
Ayush Saxena 2019-11-22 11:27:35 +05:30
parent b25e94ce29
commit c422e36397
2 changed files with 4 additions and 3 deletions

View File

@ -530,6 +530,7 @@ public class RouterAdmin extends Configured implements Tool {
for (String nsId : nss) { for (String nsId : nss) {
if (!existingEntry.addDestination(nsId, dest)) { if (!existingEntry.addDestination(nsId, dest)) {
System.err.println("Cannot add destination at " + nsId + " " + dest); System.err.println("Cannot add destination at " + nsId + " " + dest);
return false;
} }
} }
if (readonly) { if (readonly) {

View File

@ -159,6 +159,8 @@ public class TestRouterAdminCLI {
String dest = "/addmounttable"; String dest = "/addmounttable";
String[] argv = new String[] {"-add", src, nsId, dest}; String[] argv = new String[] {"-add", src, nsId, dest};
assertEquals(0, ToolRunner.run(admin, argv)); assertEquals(0, ToolRunner.run(admin, argv));
assertEquals(-1, ToolRunner.run(admin, argv));
stateStore.loadCache(MountTableStoreImpl.class, true); stateStore.loadCache(MountTableStoreImpl.class, true);
GetMountTableEntriesRequest getRequest = GetMountTableEntriesRequest GetMountTableEntriesRequest getRequest = GetMountTableEntriesRequest
@ -744,9 +746,7 @@ public class TestRouterAdminCLI {
// verify multi args ClrQuota // verify multi args ClrQuota
String dest1 = "/QuotaMounttable1"; String dest1 = "/QuotaMounttable1";
// Add mount table entries. // Add one more mount table entry.
argv = new String[] {"-add", src, nsId, dest};
assertEquals(0, ToolRunner.run(admin, argv));
argv = new String[] {"-add", src1, nsId, dest1}; argv = new String[] {"-add", src1, nsId, dest1};
assertEquals(0, ToolRunner.run(admin, argv)); assertEquals(0, ToolRunner.run(admin, argv));