8000 HDFS-16953. RBF: Mount table store APIs should update cache only if state store record is successfully updated by virajjasani · Pull Request #5482 · apache/hadoop · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

HDFS-16953. RBF: Mount table store APIs should update cache only if state store record is successfully updated #5482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public AddMountTableEntryResponse addMountTableEntry(
AddMountTableEntryResponse response =
AddMountTableEntryResponse.newInstance();
response.setStatus(status);
updateCacheAllRouters();
if (status) {
updateCacheAllRouters();
}
return response;
} else {
AddMountTableEntryResponse response =
Expand All @@ -139,7 +141,9 @@ public UpdateMountTableEntryResponse updateMountTableEntry(
UpdateMountTableEntryResponse response =
UpdateMountTableEntryResponse.newInstance();
response.setStatus(status);
updateCacheAllRouters();
if (status) {
updateCacheAllRouters();
}
return response;
} else {
UpdateMountTableEntryResponse response =
Expand Down Expand Up @@ -170,7 +174,9 @@ public RemoveMountTableEntryResponse removeMountTableEntry(
RemoveMountTableEntryResponse response =
RemoveMountTableEntryResponse.newInstance();
response.setStatus(status);
updateCacheAllRouters();
if (status) {
updateCacheAllRouters();
}
return response;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ public void testAddMountTable() throws Exception {
assertEquals(0, ToolRunner.run(admin, argv));
assertEquals(-1, ToolRunner.run(admin, argv));


stateStore.loadCache(MountTableStoreImpl.class, true);
verifyMountTableContents(src, dest);

GetMountTableEntriesRequest getRequest = GetMountTableEntriesRequest
.newInstance(src);
GetMountTableEntriesResponse getResponse = client.getMountTableManager()
Expand Down Expand Up @@ -207,6 +208,15 @@ public void testAddMountTable() throws Exception {
assertTrue(mountTable.isFaultTolerant());
}

private void verifyMountTableContents(String src, String dest) throws Exception {
String[] argv = new String[] {"-ls", "/"};
System.setOut(new PrintStream(out));
assertEquals(0, ToolRunner.run(admin, argv));
String response = out.toString();
assertTrue("The response should have " + src + ": " + response, response.contains(src));
assertTrue("The response should have " + dest + ": " + response, response.contains(dest));
}

@Test
public void testAddMountTableNotNormalized() throws Exception {
String nsId = "ns0";
Expand Down
0