Skip to content

Commit

Permalink
[fix][broker] Invalidate metadata children cache after key deleted (a…
Browse files Browse the repository at this point in the history
…pache#20363)

(cherry picked from commit 64831dc)
  • Loading branch information
Shawyeok authored and nicoloboschi committed Jul 17, 2023
1 parent 9f39688 commit ba7f03e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,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 All @@ -232,6 +233,7 @@ public final CompletableFuture<Void> delete(String path, Optional<Long> expected
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 ba7f03e

Please sign in to comment.