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 boolean addMount(String mount, String[] nss, String dest,
for (String nsId : nss) {
if (!existingEntry.addDestination(nsId, dest)) {
System.err.println("Cannot add destination at " + nsId + " " + dest);
return false;
}
}
if (readonly) {

View File

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