Skip to content

Commit

Permalink
[fix][broker] Invalidate metadata children cache after key deleted (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawyeok authored May 24, 2023
1 parent 3f2978d commit 7dcb3ea
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ public void accept(Notification n) {

if (type == NotificationType.Created || type == NotificationType.Deleted) {
existsCache.synchronous().invalidate(path);
childrenCache.synchronous().invalidate(path);
String parent = parent(path);
if (parent != null) {
childrenCache.synchronous().invalidate(parent);
Expand Down Expand Up @@ -385,6 +386,7 @@ private CompletableFuture<Void> deleteInternal(String path, Optional<Long> expec
// Ensure caches are invalidated before the operation is confirmed
return storeDelete(path, expectedVersion).thenRun(() -> {
existsCache.synchronous().invalidate(path);
childrenCache.synchronous().invalidate(path);
String parent = parent(path);
if (parent != null) {
childrenCache.synchronous().invalidate(parent);
Expand Down

0 comments on commit 7dcb3ea

Please sign in to comment.