Skip to content

Commit b824fa7

Browse files
committed
HDFS-16953. RBF Mount table store APIs should update cache only if state store record is successfully updated
1 parent 759ddeb commit b824fa7

File tree

1 file changed

+9
-3
lines changed
  • hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/impl

1 file changed

+9
-3
lines changed

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/impl/MountTableStoreImpl.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ public AddMountTableEntryResponse addMountTableEntry(
117117
AddMountTableEntryResponse response =
118118
AddMountTableEntryResponse.newInstance();
119119
response.setStatus(status);
120-
updateCacheAllRouters();
120+
if (status) {
121+
updateCacheAllRouters();
122+
}
121123
return response;
122124
} else {
123125
AddMountTableEntryResponse response =
@@ -139,7 +141,9 @@ public UpdateMountTableEntryResponse updateMountTableEntry(
139141
UpdateMountTableEntryResponse response =
140142
UpdateMountTableEntryResponse.newInstance();
141143
response.setStatus(status);
142-
updateCacheAllRouters();
144+
if (status) {
145+
updateCacheAllRouters();
146+
}
143147
return response;
144148
} else {
145149
UpdateMountTableEntryResponse response =
@@ -170,7 +174,9 @@ public RemoveMountTableEntryResponse removeMountTableEntry(
170174
RemoveMountTableEntryResponse response =
171175
RemoveMountTableEntryResponse.newInstance();
172176
response.setStatus(status);
173-
updateCacheAllRouters();
177+
if (status) {
178+
updateCacheAllRouters();
179+
}
174180
return response;
175181
}
176182

0 commit comments

Comments
 (0)